:host, .theme-site-access, .theme-site-access *, .theme-site-access *::before, .theme-site-access *::after {
    box-sizing: border-box;
}

:host {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

html.theme-site-access-required,
html.theme-site-access-required body {
    overflow: hidden;
}

.theme-site-access[hidden] {
    display: none !important;
}

.theme-site-access {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(22px, 5vh, 48px) clamp(18px, 5vw, 64px);
    color: var(--theme-text);
}

.theme-site-access__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 14%, rgb(var(--theme-accent-secondary-rgb) / 0.14), transparent 32rem),
        radial-gradient(circle at 82% 82%, rgb(var(--theme-accent-primary-rgb) / 0.12), transparent 35rem),
        linear-gradient(145deg, rgb(var(--theme-section-1-rgb) / 0.90), rgb(var(--theme-background-deep-rgb) / 0.97));
    backdrop-filter: blur(14px);
}

.theme-site-access__dialog {
    position: relative;
    width: min(700px, 100%);
    max-height: calc(100dvh - clamp(44px, 10vh, 96px));
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid rgb(var(--theme-accent-highlight-rgb) / 0.48);
    border-radius: 22px;
    background:
        linear-gradient(160deg, rgb(var(--theme-panel-raised-rgb) / 0.985), rgb(var(--theme-background-soft-rgb) / 0.99));
    box-shadow:
        0 28px 80px rgb(var(--theme-shadow-rgb) / 0.58),
        0 0 0 1px rgb(var(--theme-text-rgb) / 0.025) inset,
        0 0 48px rgb(var(--theme-accent-secondary-rgb) / 0.07);
}

.theme-site-access__dialog::before {
    position: absolute;
    inset: 9px;
    border: 1px solid rgb(var(--theme-accent-highlight-rgb) / 0.14);
    border-radius: 16px;
    content: "";
    pointer-events: none;
}

.theme-site-access__inner {
    position: relative;
    padding: 34px 36px 30px;
    text-align: center;
}

.theme-site-access__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--theme-accent-highlight-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.theme-site-access__signal {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--theme-accent-secondary);
    box-shadow: 0 0 15px rgb(var(--theme-accent-secondary-rgb) / 0.65);
}

.theme-site-access__title {
    margin: 18px 0 12px;
    color: var(--theme-text);
    font-family: var(--theme-serif);
    font-size: clamp(28px, 3.2vw, 39px);
    font-weight: 600;
    line-height: 1.26;
}

.theme-site-access__description {
    width: min(560px, 100%);
    margin: 0 auto;
    color: var(--theme-text-soft);
    font-size: 14px;
    line-height: 1.8;
}

.theme-site-access__guide {
    width: min(560px, 100%);
    margin: 24px auto 0;
    padding: 18px 20px;
    border: 1px solid rgb(var(--theme-accent-primary-rgb) / 0.24);
    border-radius: 15px;
    background: rgb(var(--theme-panel-contrast-rgb) / 0.76);
    text-align: left;
}

.theme-site-access__guide p {
    margin: 0 0 9px;
    color: var(--theme-accent-primary-soft);
    font-size: 13px;
    font-weight: 700;
}

.theme-site-access__guide ol {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-left: 1.55em;
    color: var(--theme-text-dim);
    font-size: 13px;
    line-height: 1.65;
}

.theme-site-access__action {
    display: inline-flex;
    min-width: min(310px, 100%);
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 13px;
    margin-top: 23px;
    padding: 13px 22px;
    border: 1px solid var(--theme-accent-primary-soft);
    border-radius: 999px;
    background: var(--theme-accent-primary);
    color: var(--theme-on-primary);
    box-shadow: 0 12px 30px rgb(var(--theme-accent-primary-rgb) / 0.16);
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.theme-site-access__action:hover,
.theme-site-access__action:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 15px 36px rgb(var(--theme-accent-primary-rgb) / 0.22);
}

.theme-site-access__action:disabled {
    cursor: wait;
    opacity: .72;
    transform: none;
}

.theme-site-access__arrow {
    display: inline-flex;
    align-items: center;
}

.theme-site-access__arrow .theme-icon {
    width: 18px;
    height: 18px;
    vertical-align: 0;
}

.theme-site-access__status {
    min-height: 1.5em;
    margin: 12px auto 0;
    color: var(--theme-accent-secondary-soft);
    font-size: 12px;
    line-height: 1.55;
}

.theme-site-access__status:empty {
    margin-top: 0;
    min-height: 0;
}

.theme-site-access__note {
    width: min(520px, 100%);
    margin: 15px auto 0;
    color: var(--theme-muted);
    font-size: 11px;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .theme-site-access {
        padding: 18px;
    }

    .theme-site-access__dialog {
        max-height: calc(100dvh - 36px);
        border-radius: 18px;
    }

    .theme-site-access__dialog::before {
        inset: 7px;
        border-radius: 13px;
    }

    .theme-site-access__inner {
        padding: 27px 20px 24px;
    }

    .theme-site-access__title {
        margin-top: 15px;
        font-size: clamp(26px, 8vw, 34px);
    }

    .theme-site-access__description {
        font-size: 13px;
        line-height: 1.7;
    }

    .theme-site-access__guide {
        margin-top: 19px;
        padding: 15px 16px;
    }

    .theme-site-access__action {
        width: 100%;
        min-width: 0;
        margin-top: 19px;
    }
}

.theme-site-access {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    font-family: var(--theme-sans);
}

.theme-site-access__dialog,
.theme-site-access__inner,
.theme-site-access__description,
.theme-site-access__guide,
.theme-site-access__note {
    max-width: 100%;
}

.theme-site-access__title,
.theme-site-access__description,
.theme-site-access__guide,
.theme-site-access__note,
.theme-site-access__status,
.theme-site-access__action {
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 640px) {
    .theme-site-access {
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }

    .theme-site-access__dialog {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    .theme-site-access__inner {
        width: 100%;
        min-width: 0;
        padding: 24px 16px 20px;
    }

    .theme-site-access__guide {
        width: 100%;
        min-width: 0;
        padding: 14px;
    }

    .theme-site-access__action {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-inline: 16px;
    }
}
