.adi-noah-modal,
.adi-noah-modal * {
    box-sizing: border-box;
}

.adi-noah-modal {
    position: fixed;
    inset: 0;
    z-index: 100100; /* Above the navigation wrapper's 99999 stacking layer. */
    display: grid;
    place-items: center;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
             max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.adi-noah-modal.hidden,
.adi-noah-modal[hidden] {
    display: none !important;
}

.adi-noah-modal .adi-is-hidden {
    display: none !important;
}

.adi-noah-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 13, 29, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.adi-noah-frame {
    position: relative;
    z-index: 1;
    width: min(100%, 72rem);
    width: min(100%, 72rem, calc(177.78dvh - 15rem));
    margin: auto;
    padding: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 1rem;
    background: #101526;
    color: #f8fafc;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.adi-noah-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.75rem;
    padding: 0 0.3rem 0.3rem 0.55rem;
    gap: 0.75rem;
}

.adi-noah-title {
    margin: 0;
    overflow: hidden;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adi-noah-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.3rem;
    height: 2.3rem;
    padding: 0;
    border: 0;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.09);
    color: #f8fafc;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.adi-noah-close:hover,
.adi-noah-close:focus-visible {
    background: rgba(255, 255, 255, 0.18);
}

.adi-noah-modal button:focus-visible,
.adi-noah-modal video:focus-visible {
    outline: 2px solid #a5b4fc;
    outline-offset: 2px;
}

.adi-noah-video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: calc(100dvh - 8.5rem);
    border-radius: 0.55rem;
    background: #000;
    object-fit: contain;
}

.adi-noah-video[hidden] {
    display: none !important;
}

.adi-noah-modal [hidden] {
    display: none !important;
}

.adi-noah-time {
    min-height: 1.25rem;
    margin: 0.35rem 0.25rem 0;
    color: #aebbd0;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.adi-noah-complete {
    display: flex;
    justify-content: flex-end;
    padding: 0.45rem 0.25rem 0.1rem;
}

.adi-noah-complete button {
    min-height: 2.5rem;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
}

.adi-noah-complete button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.adi-noah-fallback {
    min-height: 2.4rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.82rem;
}

.adi-noah-fallback {
    display: block;
    margin: 0.4rem 0.25rem 0 auto;
}

@media (max-width: 639px), (max-height: 480px) {
    .adi-noah-modal {
        padding: max(0.4rem, env(safe-area-inset-top)) max(0.4rem, env(safe-area-inset-right))
                 max(0.4rem, env(safe-area-inset-bottom)) max(0.4rem, env(safe-area-inset-left));
    }

    .adi-noah-frame {
        width: min(100%, calc(177.78dvh - 13.3rem));
        padding: 0.35rem;
        border-radius: 0.75rem;
    }

    .adi-noah-video {
        max-height: calc(100dvh - 7.5rem);
        border-radius: 0.4rem;
    }
}
