.sbox {
    width: 50vh;
    height: auto;
    position: fixed;
    right: 10vh;
    bottom: 10vh;
    z-index: 999;
    box-sizing: border-box;
    visibility: hidden; /* Hide initially to prevent border flash */
    color: #111;
}

.sbox [id^="sbox-"] {
    width: 100%;
    height: 100%;
    padding: 1.25rem;
    background-color: #fff;
    border: 0.6rem solid #3289d9;
    border-radius: 0.5rem;
    box-shadow: none; 
    transform: translateX(100%); 
    transition: transform 0.5s ease; 
    position: relative;
}

.sbox [id^="sbox-"].active {
    transform: translateX(0); /* Slide in */
    box-shadow: 0 0 1.25rem -0.5rem #000; /* Apply shadow when active */
}

.sbox:has([id^="sbox-"].active) {
    visibility: visible; /* Show parent when slideout is active */
}

.sbox [id^="sbox-"] h1,
.sbox [id^="sbox-"] h2,
.sbox [id^="sbox-"] h3,
.sbox [id^="sbox-"] h4,
.sbox [id^="sbox-"] h5,
.sbox [id^="sbox-"] h6 {
    margin: 0 0 0.6rem 0;
    color: #111;
}

.sbox [id^="sbox-"] p {
    margin: 0 0 1rem 0;
    color: #111;
}

.sbox [id^="sbox-"] a.close {
    background: transparent url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3E%3C/svg%3E") 50%/1em auto no-repeat;
    width: 1rem;
    height: 1rem;
    position: absolute;
    cursor: pointer;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1;
}

.sbox [id^="sbox-"] a.close:hover {
    opacity: 0.7;
}

.sbox [id^="sbox-"] a.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background-color: #3289d9;
    text-decoration: none;
    text-align: center;
    border-radius: 0.25rem;
    transition: background-color 0.3s ease;
}

.sbox [id^="sbox-"] a.btn:hover {
    background-color: #226fb6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sbox {
        width: 90%;
        height: auto;
        max-height: 90%;
        right: auto;
        bottom: 10vh;
        z-index: 999;
        color: #111;
    }

    .sbox [id^="sbox-"] {
        padding: 1rem;
    }
}