:root {
    color-scheme: dark
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #1d293d;
    color: #f5f5f5;
    font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
    font: inherit
}

button,
a,
select {
    transition: background .16s, color .16s, border-color .16s
}

a {
    color: inherit;
    text-decoration: none
}

button {
    cursor: pointer
}

.video-portal {
    min-height: 100vh
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #0f172b;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 220px
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 22px;
    white-space: nowrap
}

.brand-play {
    background: #e9233e;
    color: white;
    width: 34px;
    height: 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 14px
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid #3c3c3c;
    border-radius: 50%;
    background: #222;
    color: #fff;
    font-size: 22px
}

.menu-button {
    border-radius: 9px;
    background: transparent
}

.icon-button:hover,
.icon-button:focus-visible {
    background: #363636
}

.search-box {
    height: 42px;
    width: min(620px, 48vw);
    display: flex
}

.search-box input {
    width: 100%;
    min-width: 0;
    border: 1px solid #343434;
    border-radius: 24px 0 0 24px;
    background: #111;
    color: #fff;
    padding: 0 20px;
    outline: none
}

.search-box input:focus {
    border-color: #6090d0
}

.search-box button {
    width: 62px;
    flex: none;
    border: 1px solid #343434;
    border-left: 0;
    border-radius: 0 24px 24px 0;
    background: #222;
    color: #fff;
    font-size: 26px
}

.search-box button:hover {
    background: #343434
}

.account {
    position: relative
}

.account-panel {
    position: absolute;
    right: 0;
    top: 55px;
    width: 322px;
    border: 1px solid #383838;
    border-radius: 14px;
    background: #232323;
    box-shadow: 0 16px 45px #0009;
    padding: 18px;
    z-index: 30
}

.account-panel[hidden] {
    display: none
}

.account-panel h2 {
    font-size: 18px;
    margin: 0 0 12px
}

.panel-caption,
.account-panel small {
    color: #aaa;
    font-size: 12px;
    line-height: 1.45
}

.visitor-form {
    display: grid;
    gap: 9px
}

.visitor-form label {
    font-size: 12px;
    margin-top: 7px
}

.visitor-form input {
    width: 100%;
    height: 41px;
    background: #111;
    border: 1px solid #777;
    border-radius: 7px;
    color: #fff;
    padding: 0 12px
}

.visitor-form button {
    height: 40px;
    border: 0;
    border-radius: 6px;
    background: #e9233e;
    color: white;
    font-weight: 700;
    margin-top: 13px
}

.visitor-form button:hover {
    background: #fa3650
}

.form-error {
    padding: 10px;
    background: #5e2330;
    border-radius: 7px;
    font-size: 12px
}

.admin-link {
    display: block;
    color: #bbb;
    font-size: 12px;
    margin-top: 18px
}

.account-panel>a,
.account-exit {
    display: block;
    width: 100%;
    padding: 11px 9px;
    border: 0;
    border-radius: 7px;
    text-align: left;
    background: none;
    color: #eee;
    font-size: 14px
}

.account-panel>a:hover,
.account-exit:hover {
    background: #373737
}

.account-name {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 14px;
    margin-bottom: 8px
}

.account-name strong,
.account-name small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px
}

.account-name strong {
    font-size: 14px
}

.portal-shell {
    display: flex;
    min-height: calc(100vh - 72px)
}

.sidebar {
    width: 220px;
    flex: none;
    padding: 17px 12px;
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow: auto
}

.sidebar.sidebar-collapsed {
    display: none
}

.sidebar-is-collapsed .portal-main {
    max-width: none
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 23px;
    min-height: 42px;
    padding: 0 15px;
    border-radius: 9px;
    margin: 3px 0;
    font-size: 14px
}

.nav-item>span {
    width: 17px;
    font-size: 18px;
    text-align: center
}

.nav-item:hover,
.nav-item.active {
    background: #292929
}

.nav-item.active {
    font-weight: 700
}

.nav-divider {
    height: 1px;
    background: #303030;
    margin: 25px 10px 20px
}

.nav-heading {
    font-size: 12px;
    color: #aaa;
    margin: 0 12px 8px
}

.portal-main {
    flex: 1;
    min-width: 0;
    padding: 26px 24px 60px
}

.catalog-heading .eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.8px;
    color: #fef9c2;
    margin: 0 0 12px;
}

.catalog-heading h1 {
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 17px;
    color: #fdc700;
}

.catalog-heading-1 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
    align-items: center;
    gap: 16px;
}

.catalog-heading-title,
.catalog-heading-filter,
.group-filter {
    min-width: 0;
}

.group-filter {
    width: 100%;
}

.group-filter select {
    background: #f4f4f4;
    border: 0;
    border-radius: 9px;
    color: #111;
    font-weight: 700;
    font-size: 13px;
    padding: 11px 14px;
    width: 100%;
    min-width: 0;
    max-width: 100%
}

.results-count {
    font-size: 13px;
    font-weight: 700;
    /* margin: 25px 0 20px */
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 18px
}

.video-card {
    min-width: 0
}

.card-cover {
    position: relative;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #081430, #184b6b);
    border-radius: 11px;
    overflow: hidden
}

.card-cover img,
.next-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.cover-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #111b;
    color: white;
    font-size: 20px;
    opacity: 0
}

.video-card:hover .cover-play,
.video-card:focus-visible .cover-play {
    opacity: 1
}

.private-cover {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: radial-gradient(circle at 25% 25%, #29678a, #0b1e31 65%)
}

.private-cover>span {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    color: #143047;
    font-size: 24px
}

.private-cover small {
    letter-spacing: 1.5px;
    font-weight: 700
}

.duration {
    position: absolute;
    right: 9px;
    bottom: 8px;
    background: #000c;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700
}

.card-details {
    display: flex;
    gap: 11px;
    padding: 11px 2px
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #50617e;
    color: white;
    display: grid;
    place-items: center;
    flex: none;
    font-size: 14px
}

.card-details h2 {
    font-size: 15px;
    line-height: 1.35;
    margin: 2px 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.card-details p {
    font-size: 12px;
    color: #aaa;
    margin: 0
}

.card-details p span {
    margin: 0 4px
}

.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 90px 20px;
    color: #aaa
}

.empty-state>span {
    font-size: 48px
}

.empty-state h2 {
    color: white;
    font-size: 20px
}

.pagination {
    margin-top: 32px
}

.pagination nav {
    display: flex;
    gap: 6px
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 7px 10px;
    background: #252525;
    border-radius: 6px
}

.watch-shell .portal-main {
    padding: 20px 24px
}

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(285px, 1fr);
    gap: 24px
}

.watch-primary {
    min-width: 0
}

.player-frame {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: #020615
}

.player-frame iframe {
    width: 100%;
    height: 100%;
    border: 0
}

.watch-primary h1 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin: 18px 0 14px
}

.watch-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap
}

.channel {
    display: flex;
    align-items: center;
    gap: 12px
}

.channel strong,
.channel small {
    display: block
}

.channel strong {
    font-size: 14px
}

.channel small {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px
}

.action-buttons button {
    border: 0;
    border-radius: 22px;
    background: #2c2c2c;
    color: #fff;
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 700
}

.action-buttons button:hover,
.action-buttons button.selected {
    background: #505050
}

.action-buttons button.selected {
    color: #ff677a
}

.description {
    white-space: normal;
    background: #242424;
    border-radius: 12px;
    padding: 16px;
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.6
}

.watch-next h2 {
    font-size: 17px;
    font-weight: 500;
    margin: 4px 0 17px
}

.next-video {
    display: flex;
    gap: 12px;
    margin-bottom: 13px
}

.next-cover {
    width: 47%;
    min-width: 130px;
    aspect-ratio: 16/9;
    border-radius: 9px;
    overflow: hidden;
    background: linear-gradient(135deg, #25436d, #12646c);
    display: grid;
    place-items: center;
    font-size: 24px
}

.next-video>span {
    flex: 1;
    min-width: 0
}

.next-video strong {
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.next-video small {
    display: block;
    color: #aaa;
    font-size: 12px;
    margin-top: 12px
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

@media(max-width:1150px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
    .watch-layout {
        grid-template-columns: minmax(0, 1fr) 290px
    }
}

@media(max-width:850px) {
    .sidebar {
        width: 68px;
        padding: 17px 5px
    }
    .nav-item {
        justify-content: center;
        padding: 0
    }
    .nav-item>span {
        width: auto
    }
    .nav-item {
        font-size: 0
    }
    .nav-heading,
    .nav-divider {
        display: none
    }
    .watch-layout {
        grid-template-columns: 1fr
    }
    .watch-next {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px
    }
    .watch-next h2 {
        grid-column: 1/-1
    }
    .topbar-brand {
        min-width: auto
    }
    .search-box {
        width: min(50vw, 500px)
    }
}

@media(max-width:700px) {
    .catalog-heading-1 {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }
}

@media(max-width:600px) {
    .topbar {
        padding: 0 12px;
        gap: 9px;
        height: 62px
    }
    .topbar-brand {
        gap: 8px
    }
    .brand {
        gap: 6px;
        font-size: 15px
    }
    .brand-play {
        width: 26px;
        height: 20px;
        font-size: 11px
    }
    .icon-button {
        width: 34px;
        height: 34px;
        font-size: 17px
    }
    .search-box {
        height: 36px;
        width: auto;
        flex: 1
    }
    .search-box input {
        padding: 0 10px;
        font-size: 12px
    }
    .search-box button {
        width: 38px;
        font-size: 19px
    }
    .account-panel {
        right: -2px;
        max-width: calc(100vw - 20px)
    }
    .portal-main {
        padding: 21px 12px
    }
    .sidebar {
        display: none
    }
    .catalog-heading h1 {
        font-size: 23px
    }
    .video-grid {
        grid-template-columns: 1fr;
        gap: 15px
    }
    .watch-shell .portal-main {
        padding: 10px 12px
    }
    .watch-next {
        grid-template-columns: 1fr
    }
    .watch-actions {
        align-items: flex-start
    }
}

@media(max-width:600px) {
    .sidebar.sidebar-mobile-open {
        display: block;
        position: fixed;
        top: 62px;
        left: 0;
        z-index: 18;
        width: 220px;
        height: calc(100vh - 62px);
        background: #161616;
        box-shadow: 12px 0 35px #0009
    }
    .sidebar.sidebar-mobile-open .nav-item {
        font-size: 14px;
        justify-content: flex-start;
        padding: 0 15px
    }
    .sidebar.sidebar-mobile-open .nav-heading,
    .sidebar.sidebar-mobile-open .nav-divider {
        display: block
    }
}

.card-cover .thumbnail-video,
.next-cover .thumbnail-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0
}

.card-cover .thumbnail-video.ready,
.next-cover .thumbnail-video.ready {
    opacity: 1
}