.page-share-slot {
    min-height: 2.75rem;
    width: min(16rem, 100%);
}
.page-share {
    position: relative;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
}
.page-share > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: .4rem .75rem;
    border: 1px solid var(--product-context-border);
    border-radius: .6rem;
    background: var(--navy-900);
    color: white;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}
.page-share > summary::-webkit-details-marker { display: none; }
.page-share[open] > summary, .page-share > summary:is(:hover, :focus-visible) {
    color: var(--gold-300);
    border-color: var(--gold-300);
}
.page-share-panel {
    --context-link-color: var(--navy-900);
    --context-link-hover: var(--navy-950);
    display: grid;
    width: min(16rem, 100%);
    max-width: calc(100vw - 2rem);
    margin-top: .3rem;
    padding: .4rem;
    border: 1px solid var(--product-context-border);
    border-radius: .6rem;
    color: var(--navy-900);
    background: white;
}
.page-share[open] { width: min(16rem, 100%); }
.page-share-panel :is(a, button) {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 2.75rem;
    padding: .4rem .65rem;
    border: 0;
    border-radius: .3rem;
    background: transparent;
    color: var(--navy-900);
    font: inherit;
    line-height: 1.25;
    text-align: start;
    text-decoration: underline;
    cursor: pointer;
}
.page-share-panel :is(a, button):is(:hover, :focus-visible) {
    background: var(--product-context-surface);
}
.page-share-panel label, .page-share-panel p { margin: 0; padding: .4rem .65rem; color: inherit; }
.page-share-panel input { width: 100%; }
.page-share-panel svg { display: none; }
.page-share-panel [hidden] { display: none; }
.page-share-panel p:empty { padding: 0; }

/* The single rail grows around its midpoint. Keeping the panel in flow
   puts the trigger at its head and preserves one continuous pointer target. */
.page-share[data-share-rail] {
    position: fixed;
    z-index: 9;
    --share-edge: max(.25rem, env(safe-area-inset-right));
    right: var(--share-edge);
    top: 50%;
    transform: translateY(-50%);
    width: calc(2.75rem + 2px);
    border: 1px solid var(--product-context-border);
    border-radius: .6rem;
    background: rgb(255 255 255 / 93%);
    box-shadow: 0 .25rem .8rem rgb(5 32 52 / 15%);
}
.page-share[data-share-rail] > summary {
    display: flex;
    width: 100%;
    min-height: 2.75rem;
    padding: .35rem .2rem;
    border: 0;
    border-radius: calc(.6rem - 1px);
}
.page-share[data-share-rail][open] > summary {
    border-radius: calc(.6rem - 1px) calc(.6rem - 1px) 0 0;
}
[data-share-rail] .share-trigger-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
[data-share-rail] .page-share-panel {
    width: 100%;
    justify-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
[data-share-rail] .page-share-panel :is(a, button) {
    position: relative;
    width: 2.75rem;
    justify-content: center;
    padding: 0;
}
[data-share-rail] .page-share-panel svg { display: block; }
[data-share-rail] .share-option-label {
    position: absolute;
    right: calc(100% + .4rem);
    width: max-content;
    max-width: min(11rem, calc(50vw - 41.5rem - var(--share-edge)));
    padding: .3rem .5rem;
    border-radius: .35rem;
    background: var(--navy-950);
    color: white;
    font-size: .85rem;
    line-height: 1.35;
    text-align: start;
    opacity: 0;
    pointer-events: none;
}
[data-share-rail] .page-share-panel :is(a, button):is(:hover, :focus-visible) .share-option-label { opacity: 1; }
[data-share-rail] .page-share-result {
    position: absolute;
    top: calc(100% + .25rem);
    right: 0;
    width: min(15rem, calc(50vw - 42.5rem - var(--share-edge)));
}
[data-share-rail] .page-share-result label:not([hidden]), [data-share-rail] .page-share-result p:not(:empty) {
    display: block;
    padding: .4rem .65rem;
    border: 1px solid var(--product-context-border);
    border-radius: .4rem;
    background: white;
    color: var(--navy-900);
}
/* Leave room for the copy feedback and contact shortcuts with all six
   actions available on a short desktop display. */
@media (max-height: 50rem) {
    .page-share[data-share-rail][open] { top: 40%; }
}
/* In a shallow side gutter the labels and copy response fit above and below
   the stack. Neither can extend sideways into the catalogue. */
@media (max-width: 103.999rem) {
    [data-share-rail] .page-share-panel :is(a, button) { position: static; }
    [data-share-rail] .share-option-label, [data-share-rail] .page-share-result {
        right: 0;
        max-width: calc(50vw - 39.25rem - var(--share-edge));
    }
    [data-share-rail] .share-option-label { bottom: calc(100% + .25rem); }
    [data-share-rail] .page-share-result { width: max-content; }
    [data-share-rail] .page-share-result:has(label:not([hidden])) { width: calc(50vw - 39.25rem - var(--share-edge)); }
}
@media (prefers-reduced-transparency: reduce) {
    .page-share[data-share-rail] { background: white; }
}
@media (forced-colors: active) {
    [data-page-share] .page-share-panel, [data-page-share] .share-option-label { color: CanvasText; background: Canvas; border: 1px solid CanvasText; }
}
