/* Help on every page (STD-020): the ? button, the drawer, the action tip, and article text. */

:root {
    --cb-drawer-width: 24rem;
}

/* The ? beside a title: "Help for this page" (HP-A2). */
.help-q {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    flex: none;
    border-radius: 9999px;
    border: 1px solid currentColor;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    opacity: 0.7;
    cursor: pointer;
    background: transparent;
}
.help-q:hover,
.help-q:focus-visible {
    opacity: 1;
}
.help-q:focus-visible,
.cb-drawer-close:focus-visible,
.cb-drawer:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* The drawer: beside the page, never over its controls on a wide screen. */
.cb-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #111827;
    border-left: 1px solid #e5e7eb;
    box-shadow: -8px 0 24px rgba(17, 24, 39, 0.12);
    transform: translateX(100%);
    transition: transform 0.2s ease-out;
}
.cb-drawer.cb-drawer-in {
    transform: translateX(0);
}
.cb-drawer[hidden] {
    display: none;
}
@media (min-width: 1024px) {
    .cb-drawer {
        width: var(--cb-drawer-width);
    }
    html.cb-help-open body {
        padding-right: var(--cb-drawer-width);
    }
    /* A dialog stays clear of the drawer instead of sitting under it. */
    html.cb-help-open [role="dialog"] {
        right: var(--cb-drawer-width);
    }
}
@media (prefers-reduced-motion: reduce) {
    .cb-drawer {
        transition: none;
    }
}

.cb-drawer-head {
    position: relative;
    padding: 1.25rem 3.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.cb-drawer-kicker {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}
.cb-drawer-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 0.15rem;
}
.cb-drawer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    color: #6b7280;
}
.cb-drawer-close:hover {
    background: #f3f4f6;
    color: #111827;
}
.cb-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}
.cb-drawer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.8rem;
    color: #6b7280;
}
.cb-drawer-open {
    color: #2563eb;
    font-weight: 600;
    white-space: nowrap;
}

/* The one shared tip (HP-A6). */
.cb-tip {
    position: fixed;
    z-index: 70;
    max-width: 18rem;
    padding: 0.5rem 0.7rem;
    border-radius: 0.5rem;
    background: #111827;
    color: #f9fafb;
    font-size: 0.78rem;
    line-height: 1.4;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.25);
    pointer-events: none;
}
.cb-tip[hidden] {
    display: none;
}

/* Article text, in the drawer and on the Help page (Tailwind's reset strips it). */
.help-article {
    font-size: 0.92rem;
    line-height: 1.65;
    color: #374151;
}
.help-article > * + * {
    margin-top: 0.85rem;
}
.help-article h2 {
    margin-top: 1.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}
.help-article h3 {
    margin-top: 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}
.help-article ol,
.help-article ul {
    padding-left: 1.4rem;
}
.help-article ol {
    list-style: decimal;
}
.help-article ul {
    list-style: disc;
}
.help-article li + li {
    margin-top: 0.3rem;
}
.help-article a {
    color: #2563eb;
    text-decoration: underline;
}
.help-article code {
    font-size: 0.85em;
    padding: 0.1rem 0.3rem;
    border-radius: 0.3rem;
    background: #f3f4f6;
}
.help-article strong {
    color: #111827;
}
.help-article table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.help-article th,
.help-article td {
    border: 1px solid #e5e7eb;
    padding: 0.4rem 0.6rem;
    text-align: left;
    vertical-align: top;
}
.help-article th {
    background: #f9fafb;
}

/* The Help page sidebar links (Pheme 2.0.0). */
.help-link { display: block; padding: .35rem .6rem; border-radius: 6px; text-decoration: none; color: var(--ink, inherit); }
.help-link[aria-current="page"] { background: var(--accent-soft, #e8eefc); color: var(--accent, #2f5bd3); font-weight: 600; }
