html, body {
    padding: 0;
    margin: 0;
    border: 0;
}

body {
    padding-top: 51px;
    background-color: #EDF1F7;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #46596a;
    box-sizing: border-box;
}

.studio-footer {
    display: block;
    width: 100%;
    height: 164px;
    border: 0;
    flex-shrink: 0;
}

.studio-page {
    width: 1098px;
    max-width: calc(100% - 32px);
    margin: 0 auto;
    padding: 28px 0 56px;
}

.studio-view-bar {
    position: sticky;
    top: 51px;
    z-index: 20;
    border-top: 1px solid #ecf0f3;
    border-bottom: 1px solid #e5ebf0;
    background: #fff;
    scroll-margin-top: 51px;
}

.studio-view-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 1098px;
    max-width: calc(100% - 32px);
    height: 63px;
    margin: 0 auto;
}

.studio-tabs {
    display: flex;
    align-self: stretch;
    gap: 36px;
}

.studio-tab {
    padding: 0 3px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #81909d;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.studio-tab:hover,
.studio-tab[aria-selected="true"] {
    color: #187ab3;
}

.studio-tab[aria-selected="true"] {
    border-bottom-color: #1489cc;
    font-weight: 600;
}

.studio-tab:focus-visible {
    outline: 2px solid #428bca;
    outline-offset: -5px;
}

.studio-view-brand {
    color: #425b6b;
    font-size: 14px;
}

.studio-view-brand > span {
    margin-left: 12px;
    color: #93a2ad;
    font-size: 11px;
}

.studio-features {
    flex: 1;
    min-height: 260px;
    border-radius: 4px;
    background: #fff;
}

.studio-page [role="tabpanel"][hidden] {
    display: none;
}

.studio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: stretch;
}

.studio-primary {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.player-card,
.meta-card,
.playlist-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.player-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.player-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #1a1a1a;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
}

.player-frame video,
.player-empty {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.player-frame video {
    display: block;
    background: #000;
    object-fit: contain;
}

.player-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9dafbe;
    font-size: 14px;
    background: #2b2b2b;
}

.player-empty[hidden] {
    display: none;
}

.meta-card {
    margin-top: 16px;
    padding: 18px 20px 20px;
    flex-shrink: 0;
}

.meta-title {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    line-height: 1.35;
    color: #46596a;
}

.meta-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.meta-categories:empty {
    display: none;
}

.meta-desc {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: #627c94;
}

.meta-desc:empty {
    display: none;
}

.meta-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.meta-links:empty {
    display: none;
    margin-top: 0;
}

.ext-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px;
    border-radius: 17px;
    background: #f7f8f8;
    color: #46596a;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    transition: box-shadow 0.2s, transform 0.1s;
}

.ext-btn img {
    width: 18px;
    height: 18px;
    display: block;
}

.ext-btn:hover {
    box-shadow: 0 6px 12px rgba(0, 46, 92, 0.2);
    color: #46596a;
}

.playlist-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.playlist-head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #edf1f7;
    font-size: 13px;
    font-weight: bold;
    color: #46596a;
    flex-shrink: 0;
}

.playlist-series {
    padding: 10px 16px 6px;
    font-size: 12px;
    color: #9dafbe;
    letter-spacing: 0.02em;
}

.playlist-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin: 12px 16px 8px;
    padding: 0 10px;
    border: 1px solid #dce7ef;
    border-radius: 5px;
    background: #f8fafc;
    color: #8ba1b2;
}

.playlist-search:focus-within {
    border-color: #1684ca;
    box-shadow: 0 0 0 2px rgba(22, 132, 202, 0.1);
    background: #fff;
}

.playlist-search svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.playlist-search input {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #46596a;
    font: inherit;
    font-size: 12px;
}

.playlist-search input::placeholder {
    color: #8ba1b2;
}

.playlist-empty {
    margin: 0;
    padding: 32px 16px;
    text-align: center;
    color: #8ba1b2;
    font-size: 13px;
    line-height: 1.7;
}

.playlist-card [hidden] {
    display: none;
}

.playlist-list {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 8px 10px;
    flex: 1;
    min-height: 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.playlist-item:hover {
    background: #f4f7fb;
}

.playlist-item.is-active {
    background: #eef6fa;
    box-shadow: inset 3px 0 0 #01fdfe;
}

.playlist-index {
    width: 22px;
    flex-shrink: 0;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #9dafbe;
}

.playlist-item.is-active .playlist-index {
    color: #46596a;
}

.playlist-thumb {
    width: 112px;
    height: 63px;
    flex-shrink: 0;
    border-radius: 3px;
    overflow: hidden;
    background: #d8dee6;
    background-size: cover;
    background-position: center;
}

.playlist-info {
    min-width: 0;
    flex: 1;
}

.playlist-title {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.4;
    color: #46596a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.playlist-categories {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 6px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
}

.playlist-categories::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.playlist-categories.is-dragging {
    cursor: grabbing;
}

.playlist-category,
.meta-category {
    max-width: 100%;
    padding: 1px 5px;
    border: 1px solid #e1edf5;
    border-radius: 3px;
    background: #f5f9fc;
    color: #64859c;
    font-size: 10px;
    font-weight: normal;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.playlist-category {
    flex-shrink: 0;
}

.meta-category {
    padding: 3px 8px;
    font-size: 12px;
}

.playlist-duration {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #9dafbe;
}

@media (min-width: 961px) {
    html, body {
        height: 100%;
    }

    body {
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .studio-page {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        padding: 20px 0 16px;
        overflow: hidden;
    }

    .studio-layout {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .studio-primary {
        overflow: hidden;
    }

    .player-card {
        flex: 1;
    }

    .player-frame {
        flex: 1;
        padding-top: 0;
        min-height: 0;
        height: auto;
    }
}

@media (min-width: 1345px) {
    .studio-page,
    .studio-view-bar-inner {
        width: 1345px;
    }

    .studio-layout {
        grid-template-columns: minmax(0, 1fr) 380px;
    }
}

@media (max-width: 960px) {
    body {
        overflow: auto;
    }

    .studio-features {
        min-height: calc(100vh - 215px);
    }

    .studio-layout {
        grid-template-columns: 1fr;
    }

    .playlist-card {
        overflow: hidden;
    }

    .playlist-list {
        max-height: min(60vh, 520px);
        overflow-y: auto;
        flex: none;
    }
}

@media (max-width: 449px) {
    .studio-view-bar-inner {
        height: 57px;
    }

    .studio-tabs {
        gap: 24px;
    }

    .studio-tab {
        font-size: 13px;
    }

    .studio-view-brand {
        font-size: 12px;
    }

    .studio-view-brand > span {
        display: none;
    }

    .playlist-thumb {
        width: 96px;
        height: 54px;
    }
}
