.context-help {
    position: fixed;

    right: 24px;
    top: 96px;

    z-index: 1000;
}


/*
 * Summary používáme jako kulaté
 * plovoucí tlačítko.
 */

.context-help-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #111;
    color: #fff;

    font-size: 24px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 5px 20px
        rgba(0, 0, 0, 0.18);

    list-style: none;
}


/* Chrome / Safari marker */

.context-help-button::-webkit-details-marker {
    display: none;
}


.context-help-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 7px 24px
        rgba(0, 0, 0, 0.23);
}


.context-help[open]
.context-help-button {
    background: #333;
}


.context-help-panel {
    position: absolute;

    right: 0;
    top: 62px;

    width: min(
        380px,
        calc(100vw - 32px)
    );

    max-height:
        min(520px, calc(100vh - 110px));

    overflow-y: auto;

    padding: 20px;

    border-radius: 16px;

    background: #fff;

    box-shadow:
        0 12px 45px
        rgba(0, 0, 0, 0.22);
}


.context-help-heading {
    margin-bottom: 14px;

    font-size: 20px;
    font-weight: 700;
}


.context-help-links {
    display: grid;
    gap: 8px;
}


.context-help-link {
    display: flex;
    flex-direction: column;

    gap: 4px;

    padding: 12px 14px;

    border: 1px solid
        rgba(0, 0, 0, 0.08);

    border-radius: 10px;

    color: inherit;
    text-decoration: none;
}


.context-help-link:hover {
    background:
        rgba(0, 0, 0, 0.035);

    border-color:
        rgba(0, 0, 0, 0.15);
}


.context-help-link strong {
    font-size: 14px;
}


.context-help-link span {
    font-size: 13px;
    line-height: 1.4;

    opacity: 0.68;
}


.context-help-all {
    display: block;

    margin-top: 16px;
    padding-top: 14px;

    border-top: 1px solid
        rgba(0, 0, 0, 0.08);

    font-weight: 700;

    color: inherit;
    text-decoration: none;
}


@media (max-width: 700px) {

    .context-help {
        right: 14px;
        top: 14px;
    }

    .context-help-button {
        width: 44px;
        height: 44px;

        font-size: 21px;
    }

    .context-help-panel {
        right: 0;
        top: 56px;
    }
}

/* Non-modal reference pane: the editor remains interactive. */
.context-help-drawer[hidden] { display: none !important; }
.context-help-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(430px, 100vw);
    z-index: 5000;
    pointer-events: none;
}
.context-help-drawer-pane {
    position: absolute;
    inset: 0;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #202020;
    box-shadow: -6px 0 24px rgba(0,0,0,.13);
    border-left: 1px solid #e4e4e4;
}
.context-help-drawer-header { flex: none; min-height: 58px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #e8e8e8; }
.context-help-drawer-title { flex: 1; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-help-close,.context-help-back { border: none; background: transparent; font: inherit; font-size: 25px; cursor: pointer; padding: 4px 8px; color: inherit; }
.context-help-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 30px 45px; overscroll-behavior: contain; }
.context-help-drawer-footer { flex: none; padding: 13px 20px; border-top: 1px solid #e8e8e8; font-size: 13px; }
.context-help-drawer-footer a { color: inherit; }
.context-help-article h1 { font-size: clamp(25px, 2.5vw, 34px); line-height: 1.2; margin: 0 0 24px; }
.context-help-article .content-article { max-width: 100%; font-size: 15px; line-height: 1.65; }
.context-help-article .content-article h1 { font-size: 25px; }
.context-help-article .content-article h2 { font-size: 21px; margin: 30px 0 12px; }
.context-help-article .content-article h3 { font-size: 18px; margin: 24px 0 10px; }
.context-help-article .content-article img { max-width: 100%; height: auto; }
.context-help-article .content-article a { color: #234d8b; }
.context-help-article .content-article pre { max-width: 100%; overflow-x: auto; }
/* On wide viewports reserve real space: no editor content sits under the pane. */
@media (min-width: 1200px) {
    body.context-help-reading {
        padding-right: 430px;
    }
    body.context-help-reading .context-help {
        right: 454px;
    }
}
@media (max-width: 700px) {
    .context-help-drawer { width: 100vw; }
    .context-help-drawer-body { padding: 20px 18px 40px; }
}
