#statbase-access {
    --sb-ink: #18243c;
    --sb-muted: #52617a;
    --sb-line: #d9e2f0;
    --sb-accent: #244ed8;
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(38rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 2rem;
    border: 1px solid var(--sb-line);
    border-radius: 24px;
    background: linear-gradient(160deg, #edf3ff 0, #fff 235px);
    box-shadow: 0 24px 80px rgb(12 24 52 / 30%);
    color: var(--sb-ink);
    font: 400 15px/1.5 system-ui, sans-serif;
    text-align: left;
}
#statbase-access *, #statbase-access *::before { box-sizing: border-box; }
#statbase-access::backdrop { background: rgb(10 21 44 / 64%); backdrop-filter: blur(4px); }
#statbase-access .statbase-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
    gap: .65rem;
    margin-bottom: 1.25rem;
    padding: .9rem;
    border: 1px solid var(--sb-line);
    border-radius: 16px;
    background: #f6f8ff;
}
#statbase-access .statbase-heading { min-width: 0; }
#statbase-access .statbase-brand {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 999px;
    background: #dce7ff;
    color: #2444a9;
    font-size: .78rem;
    font-weight: 700;
}
#statbase-access h2 {
    margin: .7rem 0 .35rem;
    color: var(--sb-ink);
    font: 750 clamp(1.45rem, 4vw, 2rem)/1.15 system-ui, sans-serif;
    letter-spacing: -.025em;
}
#statbase-access p { margin: 0; color: var(--sb-muted); }
#statbase-access [data-close] {
    position: static;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--sb-line);
    border-radius: 50%;
    background: white;
    color: var(--sb-muted);
    font: 400 1.5rem/1 system-ui, sans-serif;
    cursor: pointer;
}
#statbase-access [data-close]:hover { background: #e7eeff; }
#statbase-access .statbase-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .25rem;
    min-width: 0;
    margin: 0 0 1.5rem;
    padding: .25rem;
    border: 1px solid var(--sb-line);
    border-radius: 14px;
    background: #eaf0fb;
}
#statbase-access .statbase-modes legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
#statbase-access .statbase-modes label { position: relative; display: flex; cursor: pointer; }
#statbase-access .statbase-modes input { position: absolute; opacity: 0; }
#statbase-access .statbase-modes span {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 44px;
    padding: .4rem;
    border-radius: 10px;
    color: var(--sb-muted);
    text-align: center;
    font-weight: 650;
    line-height: 1.25;
}
#statbase-access .statbase-modes input:checked + span {
    background: white;
    color: #2444a9;
    box-shadow: 0 1px 5px rgb(15 35 78 / 14%);
}
#statbase-access [data-login] { display: grid; gap: 1.25rem; }
#statbase-access [data-invite] { display: grid; gap: 1rem; margin: 0; }
#statbase-access .statbase-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
#statbase-access [data-invite] label { display: block; min-width: 0; margin: 0; font-weight: 600; }
#statbase-access small { color: var(--sb-muted); font-weight: 400; }
#statbase-access [data-invite] input:not([type=checkbox], [type=hidden]),
#statbase-access textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: .35rem 0 0;
    padding: .65rem .8rem;
    border: 1px solid var(--sb-line);
    border-radius: 10px;
    background: #fff;
    color: var(--sb-ink);
    font: inherit;
    font-weight: 400;
}
#statbase-access textarea { height: 3.75rem; resize: vertical; }
#statbase-access [data-invite] .statbase-consent {
    position: relative;
    padding-left: 1.7rem;
    color: var(--sb-muted);
    font-size: .88rem;
    font-weight: 400;
}
#statbase-access .statbase-consent input {
    position: absolute;
    top: .15em;
    left: 0;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    appearance: auto;
    accent-color: var(--sb-accent);
}
#statbase-access .statbase-consent a { color: #2444a9; text-decoration: underline; text-underline-offset: .15em; }
#statbase-access .statbase-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: 100%;
    min-height: 48px;
    padding: .7rem 1rem;
    border: 0;
    border-radius: 12px;
    background: var(--sb-accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
#statbase-access .statbase-primary:hover { background: #1d3eae; }
#statbase-access .statbase-primary:disabled { opacity: .65; cursor: wait; }
#statbase-access :focus-visible,
#statbase-access .statbase-modes input:focus-visible + span {
    outline: 2px solid var(--sb-accent);
    outline-offset: 2px;
}
#statbase-access [data-status] {
    margin-top: 1rem;
    padding: .65rem .85rem;
    border-radius: 10px;
    background: #edf3ff;
    color: var(--sb-ink);
}
#statbase-access [hidden], #statbase-access [data-status]:empty { display: none !important; }
@media (max-width: 520px) {
    #statbase-access { padding: 1.25rem; border-radius: 18px; }

    #statbase-access .statbase-modes span { font-size: .85rem; }
}

/* Keep the site's shared form and button styles from clipping dialog content. */

#statbase-access [data-close] svg { display: block; flex: none; pointer-events: none; }
#statbase-access label,
#statbase-access label a,
#statbase-access .statbase-modes span {
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
    overflow-wrap: anywhere;
}
#statbase-access .statbase-required { color: #b42318; font-weight: 700; }
#statbase-access [data-invite] .statbase-consent { line-height: 1.5; }

