/* JEL UX 1.0.0: deliberate scrolling (tables / filters) is not suppressed. */
body.jel-content-body .jbutton,
body.jcl-body .jbutton,
body.jel-ghf-active .jbutton {
    box-sizing: border-box;
    width: fit-content;
    max-width: 100%;
    min-width: min(215px, 100%);
    min-height: 48px;
    gap: clamp(10px, 2vw, 24px);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.4;
    text-align: start;
    flex-shrink: 1;
}
body.jel-ghf-active .jbutton::after,
body.jel-content-body .jbutton::after,
body.jcl-body .jbutton::after {
    content: "↗";
    flex: 0 0 1em;
    width: 1em;
    margin-inline-start: auto;
    font-size: 20px;
    line-height: 1;
    text-align: end;
}
body.jel-content-body :is(.jhero-bottom, .jfinal-box, .jbody-content, .jel-managed-block, .jel-managed-copy),
body.jel-content-body .jhero-bottom > *,
body.jcl-body :is(.jcl-article, .jcl-source, .jcl-next),
body.jcl-body .jcl-source > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
body.jel-content-body .jhero-bottom {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
}
/* Long source URLs must wrap inside the article, not enlarge its grid track. */
body.jcl-body :is(.jcl-article, .jcl-source, .jcl-next) a,
body.jel-content-body .jbody-content a:not(.jbutton) {
    overflow-wrap: anywhere;
    word-break: normal;
}
body.jcl-body .jcl-article :is(p, li),
body.jel-content-body .jbody-content :is(p, li) {
    text-align: start;
    text-align-last: auto;
    text-justify: auto;
    hyphens: manual;
    line-height: 1.65;
}
body.jcl-body .jcl-article > :is(p, ul, ol, h2, h3, blockquote),
body.jcl-body .jcl-article .jcl-source {
    max-width: 82ch;
}
body.jel-ghf-active :is(.jghf-skip-link, .jel-skip-link):focus-visible {
    max-width: calc(100vw - 32px);
    white-space: normal;
    outline: 3px solid #fff !important;
    outline-offset: 3px;
}
body.jel-ghf-active main[id] { scroll-margin-top: 120px; }
body.jel-ghf-active main.jel-ux-skip-target:focus { outline: none; }
body.jel-ghf-active .jghf-mobile-group__title button {
    min-width: 44px;
    min-height: 44px;
}
/* Optional, native and collapsed contents for verified long-page templates. */
body.jel-ghf-active .jel-ux-toc {
    box-sizing: border-box;
    width: min(1400px, calc(100% - 64px));
    margin: 20px auto 0;
    color: #f6f6f1;
    font-size: 15px;
    line-height: 1.5;
}
body.jel-ghf-active .jel-ux-toc--inset { width: 100%; }
body.jel-ghf-active .jel-ux-toc details {
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    background: rgba(255, 255, 255, .025);
}
body.jel-ghf-active .jel-ux-toc summary {
    display: list-item;
    padding: 17px 20px;
    cursor: pointer;
    color: #b6ff35;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.5;
    list-style-position: inside;
}
body.jel-ghf-active .jel-ux-toc summary small {
    margin-inline-start: 12px;
    color: #a7ada8;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
}
body.jel-ghf-active .jel-ux-toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 24px;
    margin: 0;
    padding: 0 20px 17px 42px;
    list-style: decimal;
}
body.jel-ghf-active .jel-ux-toc li {
    min-width: 0;
    padding: 0;
    background: none;
    color: #a7ada8;
    font-size: 14px;
}
body.jel-ghf-active .jel-ux-toc a {
    display: block;
    padding: 8px 0;
    color: #e7ece7;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
}
body.jel-ghf-active .jel-ux-toc a:hover { color: #b6ff35; }
body.jel-ghf-active .jel-ux-toc :is(a, summary):focus-visible {
    outline: 2px solid #b6ff35;
    outline-offset: 3px;
    border-radius: 4px;
}
body.jel-ghf-active h2[data-jel-ux-heading] { scroll-margin-top: 120px; }
@media (max-width: 900px) {
    body.jel-content-body .jhero-bottom { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    body.jel-ghf-active .jel-ux-toc { width: calc(100% - 32px); }
    body.jel-ghf-active .jel-ux-toc--inset { width: 100%; }
    body.jel-ghf-active .jel-ux-toc ol { grid-template-columns: minmax(0, 1fr); }
    body.jel-ghf-active .jbutton,
    body.jel-content-body .jbutton,
    body.jcl-body .jbutton {
        width: 100%;
        min-width: 0;
        padding-inline: clamp(16px, 5vw, 23px);
    }
    /* Two separate 52px touch targets, with safe-area and no mutual overlap. */
    body.jel-ghf-active #jel-whatsapp-float {
        right: max(16px, env(safe-area-inset-right)) !important;
        bottom: calc(18px + env(safe-area-inset-bottom)) !important;
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
    }
    body.jel-ghf-active #jel-scroll-top {
        right: max(16px, env(safe-area-inset-right)) !important;
        bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    }
    /* Hide only auxiliary floats while entering details / choosing cookies.
       Main contact links, form submit controls and menu are never hidden. */
    html.jel-ux-form-focus body.jel-ghf-active :is(#jel-whatsapp-float, #jel-scroll-top),
    body.jghf-menu-open :is(#jel-whatsapp-float, #jel-scroll-top),
    body.jel-ghf-active:has(.jel-consent:not([hidden])) :is(#jel-whatsapp-float, #jel-scroll-top),
    body.jel-ghf-active:has(.jls-wp-cookie:not([hidden])) :is(#jel-whatsapp-float, #jel-scroll-top) {
        visibility: hidden !important;
        pointer-events: none !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.jel-ghf-active main[id] { scroll-behavior: auto; }
}
/* Full article artwork, like archive cards, must not crop embedded diagrams. */
body.jcl-body .jcl-cover img{object-fit:contain;background:#111613}

/* Append after existing refinement CSS. Auxiliary floats only; all viewports. */
html.jel-ux-form-visible body.jel-ghf-active :is(#jel-whatsapp-float, #jel-scroll-top),
html.jel-ux-form-focus body.jel-ghf-active :is(#jel-whatsapp-float, #jel-scroll-top) {
    visibility: hidden !important;
    pointer-events: none !important;
}
