html.subcat-sheet-open,
html.subcat-sheet-open body {
    overflow: hidden;
}

.subcat-sheet-root[hidden] {
    display: none !important;
}

.subcat-sheet-root {
    position: fixed;
    inset: 0;
    z-index: 9998;
}

.subcat-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .44);
    opacity: 0;
    transition: opacity .26s ease;
}

.subcat-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: min(100%, 720px);
    height: min(88vh, 900px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -16px 50px rgba(0, 0, 0, .22);
    transform: translateY(102%);
    transition: transform .26s ease;
    overflow: hidden;
}

.subcat-sheet-root.is-open .subcat-sheet-overlay {
    opacity: 1;
}

.subcat-sheet-root.is-open .subcat-sheet {
    transform: translateY(0);
}

.subcat-sheet-handle {
    flex: 0 0 auto;
    width: 46px;
    height: 5px;
    margin: 10px auto 7px;
    border-radius: 999px;
    background: #d3d6da;
}

.subcat-sheet-topbar {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 4px 18px 10px;
    text-align: center;
    border-bottom: 1px solid #eceff2;
}

.subcat-sheet-topbar strong {
    display: block;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subcat-sheet-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.subcat-sheet-header {
    padding: 17px 16px 10px;
}

.subcat-sheet-heading h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
}

.subcat-sheet-heading p {
    margin: 5px 0 0;
    color: #70757d;
    font-size: 14px;
}

.subcat-sheet-body {
    padding: 0 12px 22px;
}

.subcat-sheet-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #eceff2;
}

.subcat-sheet-close {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef0f3;
    color: #222;
    font-size: 30px;
    font-weight: 400;
    line-height: 44px;
    cursor: pointer;
}

.subcat-sheet-loading,
.subcat-sheet-message,
.subcat-sheet-empty {
    padding: 34px 18px;
    text-align: center;
    color: #6b7078;
}

.subcat-sheet-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.subcat-sheet-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #e2e5e9;
    border-top-color: #555;
    border-radius: 50%;
    animation: subcat-sheet-spin .75s linear infinite;
}

@keyframes subcat-sheet-spin {
    to { transform: rotate(360deg); }
}

@media (min-width: 721px) {
    .subcat-sheet {
        bottom: 18px;
        height: min(88vh, 900px);
        border-radius: 24px;
    }
}
