:root {
    --brand-blue: #1677ff;
    --brand-blue-strong: #0f5eea;
    --brand-cyan: #4fc3ff;
    --brand-navy: #071226;
    --brand-navy-soft: #0d1b34;
    --brand-border: rgba(108, 174, 255, .2);
    --brand-glow: rgba(22, 119, 255, .25);
}

body.is-catalog-page {
    --catalog-blue: var(--brand-blue);
}

body:is(.is-catalog-page, .is-detail-page, .is-account-page, .is-admin-page) .brand h1 span {
    color: var(--brand-blue);
}

body.is-catalog-page .nav a::after {
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
}

body.is-catalog-page .google-login {
    border-color: var(--brand-blue);
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-strong));
    box-shadow: 0 8px 22px rgba(22, 119, 255, .2);
}

body.is-catalog-page .google-login:hover {
    border-color: #3189ff;
    background: linear-gradient(135deg, #3189ff, var(--brand-blue));
}

body:is(.is-detail-page, .is-account-page, .is-admin-page, .is-watch-page) {
    --bg: #050a14;
    --panel: #0c1729;
    --panel-strong: #12233d;
    --text: #f7faff;
    --muted: #91a1b8;
    --line: rgba(116, 161, 220, .17);
    --accent: var(--brand-blue);
    --accent-2: var(--brand-cyan);
    background:
        radial-gradient(circle at 15% -10%, rgba(22, 119, 255, .13), transparent 34rem),
        #050a14;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 78px;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 68px;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(18px, 2vw, 34px);
    padding: 10px clamp(28px, 4vw, 64px);
    border-bottom: 1px solid rgba(83, 149, 234, .11);
    background: rgba(4, 9, 19, .9);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .brand {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 10px;
    order: 1;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .brand-mark {
    width: 38px;
    height: 38px;
    padding: 3px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(22, 119, 255, .22);
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .brand h1 {
    color: #f5f8ff;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -.055em;
    text-transform: uppercase;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .nav {
    gap: 3px;
    margin-left: 14px;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .nav a {
    position: relative;
    min-height: 36px;
    padding: 0 11px;
    border-radius: 4px;
    background: transparent;
    color: #b8c3d2;
    font-size: .9rem;
    font-weight: 600;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .nav a i {
    display: none;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .nav a::after {
    content: "";
    position: absolute;
    right: 11px;
    bottom: 2px;
    left: 11px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
    opacity: 0;
    transform: scaleX(.4);
    transition: opacity .18s ease, transform .18s ease;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .nav a:hover,
body:is(.is-detail-page, .is-account-page, .is-admin-page) .nav a.active {
    background: transparent;
    color: #fff;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .nav a.active::after {
    opacity: 1;
    transform: scaleX(1);
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .search {
    order: 2;
    width: clamp(220px, 24vw, 350px);
    flex: 0 1 350px;
    margin-left: auto;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .search input {
    min-height: 39px;
    border-color: rgba(120, 166, 226, .25);
    border-radius: 6px;
    background: rgba(4, 11, 24, .72);
    font-size: .9rem;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .search input:focus {
    border-color: rgba(79, 195, 255, .72);
    background: #081426;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .search-icon {
    color: #b8c7da;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .auth-actions {
    order: 3;
    flex: 0 0 auto;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .google-login {
    min-height: 38px;
    border-color: var(--brand-blue);
    border-radius: 6px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-strong));
    box-shadow: 0 8px 22px rgba(22, 119, 255, .2);
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .user-pill {
    min-height: 38px;
    border-color: transparent;
    border-radius: 6px;
    background: transparent;
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .user-pill:hover,
body:is(.is-detail-page, .is-account-page, .is-admin-page) .profile-menu[open] .user-pill {
    border-color: var(--brand-border);
    background: rgba(22, 119, 255, .09);
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .profile-dropdown,
body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-profile-dropdown {
    border-color: var(--brand-border);
    background: rgba(6, 15, 30, .98);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .42);
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .profile-dropdown-link:hover,
body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-profile-dropdown button:hover {
    background: rgba(22, 119, 255, .12);
}

body:is(.is-detail-page, .is-account-page, .is-admin-page) .flash {
    position: relative;
    z-index: 12;
    width: min(1040px, calc(100% - 32px));
    margin: 20px auto 0;
}

/* Detail page */
.detail-page-shell {
    position: relative;
    isolation: isolate;
    min-height: calc(100vh - 68px);
    overflow: hidden;
    padding: 34px clamp(28px, 5vw, 80px) 72px;
}

.detail-backdrop {
    position: absolute;
    z-index: -2;
    inset: 0;
    overflow: hidden;
}

.detail-backdrop::before {
    content: "";
    position: absolute;
    inset: -32px;
    background-image: var(--detail-image);
    background-position: 72% 20%;
    background-size: cover;
    filter: blur(18px) saturate(.72);
    opacity: .34;
    transform: scale(1.08);
}

.detail-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, #050a14 0%, rgba(5, 10, 20, .92) 42%, rgba(5, 10, 20, .5) 74%, rgba(5, 10, 20, .72) 100%),
        linear-gradient(0deg, #050a14 0%, rgba(5, 10, 20, .42) 48%, rgba(5, 10, 20, .7) 100%);
}

.detail-page-inner {
    width: min(1320px, 100%);
    margin: 0 auto;
}

.is-detail-page .back-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 24px;
    padding: 0 13px;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    background: rgba(8, 18, 34, .62);
    color: #c7d5e7;
    font-size: .82rem;
    font-weight: 700;
    backdrop-filter: blur(12px);
}

.is-detail-page .back-link:hover {
    border-color: rgba(79, 195, 255, .5);
    background: rgba(22, 119, 255, .14);
    color: #fff;
}

.is-detail-page .detail {
    grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
    gap: clamp(36px, 5vw, 72px);
    align-items: center;
    min-height: min(690px, calc(100vh - 175px));
    margin: 0;
}

.is-detail-page .detail-media {
    position: relative;
    display: block;
}

.is-detail-page .detail-poster {
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(125, 181, 255, .26);
    border-radius: 18px;
    background: #0b1629;
    box-shadow:
        0 34px 80px rgba(0, 0, 0, .5),
        0 0 0 7px rgba(22, 119, 255, .045),
        0 0 52px rgba(22, 119, 255, .13);
}

.is-detail-page .detail-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(0deg, rgba(4, 10, 21, .64), transparent 35%);
    pointer-events: none;
}

.detail-poster-badge {
    position: absolute;
    z-index: 2;
    right: 14px;
    bottom: 14px;
    left: 14px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px;
    background: rgba(5, 13, 27, .72);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.detail-poster-badge i {
    color: var(--brand-cyan);
}

.detail-copy {
    max-width: 790px;
}

.detail-kicker {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    color: #b9d8ff;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.detail-kicker span {
    width: 27px;
    height: 27px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--brand-blue), #24b9ff);
    color: #fff;
    box-shadow: 0 8px 22px rgba(22, 119, 255, .28);
}

.is-detail-page .detail-title {
    max-width: 900px;
    margin: 0;
    color: #fff;
    font-size: clamp(2.7rem, 5.6vw, 5.4rem);
    font-weight: 900;
    line-height: .98;
    letter-spacing: -.065em;
    text-wrap: balance;
    text-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

.is-detail-page .stats {
    gap: 8px;
    margin-top: 22px;
}

.is-detail-page .stat {
    min-height: 32px;
    gap: 6px;
    padding: 0 10px;
    border-color: rgba(118, 173, 243, .2);
    border-radius: 6px;
    background: rgba(8, 20, 39, .62);
    color: #b7c5d8;
    font-size: .78rem;
    backdrop-filter: blur(8px);
}

.is-detail-page .stat i,
.is-detail-page .stat strong {
    color: var(--brand-cyan);
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
}

.detail-watch-stack {
    display: grid;
    gap: 8px;
}

.is-detail-page .watch {
    min-width: 178px;
    min-height: 50px;
    gap: 10px;
    padding: 0 24px;
    border: 1px solid rgba(100, 185, 255, .5);
    border-radius: 7px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-strong));
    box-shadow: 0 14px 34px rgba(22, 119, 255, .25);
    color: #fff;
    font-size: .95rem;
}

.is-detail-page .watch:hover {
    border-color: rgba(151, 218, 255, .75);
    background: linear-gradient(135deg, #3189ff, var(--brand-blue));
    transform: translateY(-1px);
}

.is-detail-page .watch.disabled {
    border-color: var(--line);
    background: rgba(255, 255, 255, .07);
    box-shadow: none;
}

.is-detail-page .watch-progress-note {
    color: #9fb4cf;
    font-size: .78rem;
    text-align: left;
}

.is-detail-page .detail-description {
    max-width: 760px;
    margin-top: 24px;
    color: #bdc8d8;
    font-size: clamp(.94rem, 1.2vw, 1.04rem);
    line-height: 1.75;
}

.detail-taxonomy {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 28px;
    margin-top: 26px;
}

.is-detail-page .detail-subtitle {
    margin: 0;
    color: #7390b3;
    font-size: .69rem;
    letter-spacing: .13em;
}

.is-detail-page .tag-list {
    gap: 7px;
    margin-top: 10px;
}

.is-detail-page .tag {
    min-height: 30px;
    padding: 0 10px;
    border-color: rgba(90, 151, 226, .2);
    border-radius: 999px;
    background: rgba(15, 35, 65, .72);
    color: #c3d5ec;
    font-size: .73rem;
}

/* Account history */
.is-account-page .account-page {
    width: min(1380px, calc(100% - clamp(32px, 8vw, 112px)));
    display: grid;
    gap: 24px;
    margin: 0 auto;
    padding-top: 48px;
}

.is-account-page .account-heading {
    min-height: 150px;
    align-items: center;
    margin: 0;
    padding: 28px 30px;
    border: 1px solid var(--brand-border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 88% 20%, rgba(79, 195, 255, .14), transparent 17rem),
        linear-gradient(135deg, rgba(17, 40, 75, .94), rgba(7, 19, 38, .94));
    box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
}

.account-heading-main,
.admin-heading-main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.account-heading-icon,
.admin-heading-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(116, 196, 255, .3);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(22, 119, 255, .3), rgba(79, 195, 255, .1));
    color: #82d5ff;
    font-size: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.is-account-page .account-kicker,
.is-admin-page .admin-kicker {
    margin: 0 0 6px;
    color: var(--brand-cyan);
    font-size: .7rem;
    letter-spacing: .13em;
}

.is-account-page .account-heading h2,
.is-admin-page .admin-heading h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.3rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.05em;
}

.account-heading-copy,
.admin-heading-copy {
    margin: 9px 0 0;
    color: #97aac4;
    font-size: .88rem;
}

.account-title-count {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    background: rgba(6, 17, 34, .55);
    color: #bed1e9;
    font-size: .76rem;
    font-weight: 700;
}

.is-account-page .account-progress-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.is-account-page .account-progress-card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 16px;
    padding: 12px;
    overflow: hidden;
    border-color: var(--brand-border);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(14, 30, 54, .96), rgba(8, 18, 34, .96));
    box-shadow: 0 16px 36px rgba(0, 0, 0, .16);
}

.is-account-page .account-progress-card:hover {
    border-color: rgba(79, 195, 255, .38);
    background: linear-gradient(145deg, rgba(18, 42, 76, .98), rgba(9, 22, 43, .98));
    box-shadow: 0 22px 44px rgba(0, 0, 0, .22), 0 0 28px rgba(22, 119, 255, .08);
    transform: translateY(-3px);
}

.is-account-page .account-progress-thumb {
    position: relative;
    width: 104px;
    border-color: rgba(130, 181, 245, .2);
    border-radius: 10px;
}

.account-progress-episode {
    position: absolute;
    right: 7px;
    bottom: 7px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 5px;
    background: rgba(3, 10, 21, .82);
    color: #fff;
    font-size: .63rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.is-account-page .account-progress-body {
    gap: 10px;
}

.is-account-page .account-progress-title {
    color: #f7faff;
    font-size: .95rem;
    font-weight: 800;
}

.is-account-page .account-progress-meta {
    gap: 7px 10px;
    color: #8498b3;
    font-size: .72rem;
}

.account-progress-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #78bdff;
}

.account-progress-status.complete {
    color: #72ddb0;
}

.is-account-page .account-progress-track {
    height: 5px;
    background: rgba(118, 168, 228, .12);
}

.is-account-page .account-progress-fill {
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
    box-shadow: 0 0 10px rgba(79, 195, 255, .35);
}

.is-account-page .account-progress-action {
    min-height: 36px;
    border-color: rgba(77, 164, 255, .42);
    border-radius: 7px;
    background: rgba(22, 119, 255, .16);
    color: #dcecff;
    font-size: .78rem;
}

.is-account-page .account-progress-action:hover {
    border-color: rgba(106, 194, 255, .7);
    background: var(--brand-blue);
    color: #fff;
}

.is-account-page .account-progress-action.disabled {
    border-color: var(--line);
    background: rgba(255, 255, 255, .04);
}

.account-empty {
    min-height: 330px !important;
    align-content: center;
    gap: 10px;
    text-align: center;
}

.account-empty > span {
    width: 58px;
    height: 58px;
    display: inline-grid;
    place-items: center;
    margin: 0 auto 4px;
    border-radius: 50%;
    background: rgba(22, 119, 255, .15);
    color: #72cbff;
}

.account-empty strong {
    color: #fff;
    font-size: 1.1rem;
}

.account-empty p {
    margin: 0;
}

.account-empty a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto 0;
    padding: 0 15px;
    border-radius: 7px;
    background: var(--brand-blue);
    color: #fff;
    font-weight: 800;
}

/* Admin */
.is-admin-page .admin-page {
    width: min(1380px, calc(100% - clamp(32px, 8vw, 112px)));
    margin: 0 auto;
    padding-top: 48px;
}

.is-admin-page .back-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0 12px;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    background: rgba(10, 24, 45, .68);
    color: #a9bdd7;
    font-size: .78rem;
}

.is-admin-page .admin-heading {
    align-items: center;
    margin: 0 0 22px;
    padding: 4px 0 8px;
}

.admin-user-avatar {
    position: relative;
    overflow: hidden;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(102, 181, 255, .3);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(22, 119, 255, .3), rgba(12, 38, 76, .8));
    color: #e8f4ff;
    font-size: .9rem;
    font-weight: 900;
}

.admin-user-avatar img,
.admin-user-avatar > span {
    width: 100%;
    height: 100%;
}

.admin-user-avatar img {
    display: block;
    object-fit: cover;
}

.admin-user-avatar > span {
    display: grid;
    place-items: center;
}

.admin-user-avatar--large {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
    border-radius: 17px;
    font-size: 1.2rem;
}

.is-admin-page .admin-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.is-admin-page .admin-stat-card {
    min-height: 116px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-color: var(--brand-border);
    border-radius: 14px;
    background:
        radial-gradient(circle at 100% 0, rgba(79, 195, 255, .09), transparent 12rem),
        linear-gradient(145deg, rgba(15, 33, 59, .96), rgba(8, 19, 37, .96));
    box-shadow: 0 16px 38px rgba(0, 0, 0, .16);
}

.admin-stat-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(22, 119, 255, .15);
    color: #76caff !important;
    font-size: 1.05rem !important;
}

.admin-stat-icon.live {
    background: rgba(70, 211, 155, .12);
    color: #75e4b7 !important;
}

.is-admin-page .admin-stat-card > div {
    display: grid;
    gap: 8px;
}

.is-admin-page .admin-stat-card span:not(.admin-stat-icon) {
    color: #8da2be;
    font-size: .75rem;
}

.is-admin-page .admin-stat-card strong {
    color: #fff;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    letter-spacing: -.04em;
}

.is-admin-page .admin-filters {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
    gap: 12px;
    margin: 0 0 15px;
    padding: 13px;
    border: 1px solid var(--brand-border);
    border-radius: 13px;
    background: rgba(8, 19, 36, .72);
}

.is-admin-page .admin-filters input,
.is-admin-page .admin-filters select,
.is-admin-page .admin-form input {
    min-height: 46px;
    border-color: rgba(112, 166, 232, .2);
    border-radius: 8px;
    background: #0b192e;
}

.is-admin-page .admin-filters input:focus,
.is-admin-page .admin-filters select:focus,
.is-admin-page .admin-form input:focus {
    border-color: rgba(79, 195, 255, .6);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, .11);
}

.is-admin-page .admin-result-count {
    margin: 0 2px 14px;
    color: #8297b2;
    font-size: .78rem;
}

.is-admin-page .admin-user-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.is-admin-page .admin-user-card {
    gap: 15px;
    padding: 16px;
    border-color: var(--brand-border);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(14, 30, 54, .96), rgba(8, 18, 34, .96));
    box-shadow: 0 14px 34px rgba(0, 0, 0, .14);
}

.is-admin-page .admin-user-card:hover {
    border-color: rgba(79, 195, 255, .42);
    background: linear-gradient(145deg, rgba(18, 42, 76, .98), rgba(9, 22, 43, .98));
    box-shadow: 0 20px 42px rgba(0, 0, 0, .2), 0 0 30px rgba(22, 119, 255, .07);
    transform: translateY(-3px);
}

.admin-user-profile,
.admin-user-card-side {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.admin-user-card-side {
    flex: 0 0 auto;
    gap: 9px;
}

.admin-user-card-side > i {
    color: #58708e;
    font-size: .7rem;
}

.is-admin-page .admin-user-name {
    color: #f7faff;
    font-size: .9rem;
}

.is-admin-page .admin-user-email {
    color: #7f94af;
    font-size: .72rem;
}

.is-admin-page .admin-user-meta {
    color: #8ca1bc;
    font-size: .76rem;
}

.is-admin-page .admin-pill {
    min-height: 26px;
    border-color: rgba(70, 211, 155, .3);
    border-radius: 999px;
    background: rgba(70, 211, 155, .1);
    color: #9af0cd;
    font-size: .65rem;
}

.is-admin-page .admin-pill.danger {
    border-color: rgba(255, 115, 132, .36);
    background: rgba(255, 91, 110, .1);
    color: #ffb5c0;
}

.is-admin-page .admin-detail-grid {
    gap: 16px;
    margin-bottom: 16px;
}

.is-admin-page .admin-panel {
    padding: 22px;
    border-color: var(--brand-border);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(14, 30, 54, .96), rgba(8, 18, 34, .96));
    box-shadow: 0 16px 38px rgba(0, 0, 0, .15);
}

.is-admin-page .admin-panel h3 {
    color: #f5f9ff;
    font-size: 1rem;
}

.is-admin-page .admin-facts div {
    border-color: rgba(111, 159, 219, .13);
}

.is-admin-page .admin-facts dt,
.is-admin-page .admin-form label {
    color: #899eb9;
    font-size: .76rem;
}

.is-admin-page .admin-facts dd {
    color: #e7f1ff;
}

.is-admin-page .admin-button {
    min-height: 46px;
    border-color: rgba(99, 181, 255, .46);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-strong));
    box-shadow: 0 10px 24px rgba(22, 119, 255, .18);
}

.is-admin-page .admin-button:hover {
    border-color: rgba(151, 218, 255, .7);
    background: linear-gradient(135deg, #3189ff, var(--brand-blue));
}

.is-admin-page .admin-button.secondary {
    border-color: var(--brand-border);
    background: rgba(16, 35, 62, .8);
    box-shadow: none;
}

.is-admin-page .admin-button.danger,
.is-admin-page .admin-icon-button.danger {
    border-color: rgba(255, 112, 129, .38);
    background: rgba(255, 91, 110, .1);
    color: #ffb8c2;
    box-shadow: none;
}

.is-admin-page .admin-history-row {
    padding: 14px;
    border-color: rgba(111, 159, 219, .15);
    border-radius: 10px;
    background: rgba(6, 16, 31, .54);
}

.is-admin-page .pager .more,
.is-account-page .pager .more {
    min-height: 42px;
    padding: 0 16px;
    border-color: var(--brand-border);
    border-radius: 8px;
    background: rgba(13, 31, 57, .84);
}

/* Watch experience: styling only; playback and navigation hooks stay untouched. */
body.is-watch-page {
    background: #02060d;
}

.watch-ambient {
    position: fixed;
    z-index: -1;
    inset: -36px;
    overflow: hidden;
    background-image: var(--watch-art);
    background-position: center;
    background-size: cover;
    filter: blur(34px) saturate(.62);
    opacity: .18;
    transform: scale(1.08);
    pointer-events: none;
}

.watch-ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(22, 119, 255, .15), transparent 30rem),
        rgba(2, 6, 13, .72);
}

.is-watch-page .watch-page-main {
    position: relative;
    z-index: 1;
}

.is-watch-page .topbar {
    border-bottom: 1px solid rgba(100, 164, 242, .1);
}

.is-watch-page .brand h1 span {
    color: var(--brand-blue);
}

.is-watch-page .reels-frame {
    border: 1px solid rgba(91, 174, 255, .36);
    border-radius: 18px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, .55),
        0 0 0 6px rgba(22, 119, 255, .045),
        0 0 52px rgba(22, 119, 255, .13);
}

.is-watch-page .reels-video {
    accent-color: var(--brand-blue);
}

.is-watch-page .reels-back {
    border-color: rgba(134, 199, 255, .34);
    background: rgba(5, 16, 31, .62);
}

.is-watch-page .reels-back:hover {
    border-color: rgba(134, 211, 255, .6);
    background: rgba(22, 119, 255, .3);
}

.is-watch-page .reels-episode-nav {
    width: 58px;
    height: 58px;
    border: 1px solid rgba(107, 182, 255, .22);
    border-radius: 50%;
    background: rgba(8, 23, 43, .62);
    color: #a8d8ff;
    font-size: 1.45rem;
    text-shadow: none;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .3);
    backdrop-filter: blur(12px);
}

.is-watch-page .reels-episode-nav:hover {
    border-color: rgba(116, 206, 255, .6);
    background: rgba(22, 119, 255, .3);
    color: #fff;
}

.is-watch-page .reels-episode-nav--previous {
    right: calc(100% + 24px);
}

.is-watch-page .reels-episode-nav--next {
    left: calc(100% + 24px);
}

.is-watch-page .reels-episode-picker {
    top: calc(50% + 68px);
    left: calc(100% + 24px);
    min-width: 70px;
    border-color: var(--brand-border);
    border-radius: 10px;
    background: rgba(9, 24, 45, .9);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .3);
}

.is-watch-page .reels-episode-picker:hover,
.is-watch-page .reels-episode-picker:focus-visible {
    border-color: rgba(79, 195, 255, .6);
    background: rgba(22, 119, 255, .22);
}

.is-watch-page .reels-overlay {
    background: linear-gradient(180deg, transparent, rgba(2, 8, 17, .92));
}

.is-watch-page .reels-title {
    color: #fff;
    font-weight: 800;
    text-shadow: 0 3px 16px rgba(0, 0, 0, .8);
}

.is-watch-page .episode-sheet-panel {
    border-color: rgba(93, 164, 247, .22);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0, rgba(79, 195, 255, .09), transparent 15rem),
        rgba(7, 17, 33, .98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .36);
}

.episode-sheet-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.episode-current-chip {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid rgba(84, 177, 255, .3);
    border-radius: 999px;
    background: rgba(22, 119, 255, .12);
    color: #bedfff;
    font-size: .66rem;
    font-weight: 700;
}

.episode-current-chip > span {
    color: #7f9bbd;
    text-transform: uppercase;
}

.episode-current-chip strong {
    color: #fff;
}

.is-watch-page .episode-sheet-kicker {
    color: #7890ad;
}

.is-watch-page .episode-sheet-header h2 {
    color: #fff;
}

.is-watch-page .episode-sheet-close,
.is-watch-page .episode-batch,
.is-watch-page .episode-box {
    border-color: rgba(108, 159, 222, .17);
    background: rgba(14, 31, 56, .82);
}

.is-watch-page .episode-batch:hover,
.is-watch-page .episode-batch[aria-selected="true"] {
    border-color: rgba(79, 195, 255, .58);
    background: rgba(22, 119, 255, .18);
    color: #fff;
}

.is-watch-page .episode-box:hover,
.is-watch-page .episode-box.active {
    border-color: rgba(111, 207, 255, .72);
    background: linear-gradient(145deg, var(--brand-blue), var(--brand-blue-strong));
    box-shadow: 0 8px 18px rgba(22, 119, 255, .24);
}

.is-watch-page .episode-progress-line::before {
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
}

.is-watch-page .episode-lock-dialog {
    border-color: var(--brand-border);
    border-radius: 14px;
    background: #0a182d;
}

.is-watch-page .episode-lock-icon {
    border-color: rgba(79, 195, 255, .32);
    background: rgba(22, 119, 255, .12);
    color: var(--brand-cyan);
}

.is-watch-page .episode-lock-close {
    border-color: rgba(89, 182, 255, .5);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-strong));
}

.is-watch-page .watch-episode-button,
.is-watch-page .watch-mobile-menu summary {
    border-color: rgba(115, 190, 255, .32);
    background: rgba(5, 18, 35, .65);
    backdrop-filter: blur(10px);
}

.is-watch-page .watch-mobile-dropdown {
    border-color: var(--brand-border);
    background: rgba(5, 14, 28, .98);
}

@media (min-width: 1240px) {
    .is-watch-page .watch-layout {
        grid-template-columns: minmax(82px, 1fr) minmax(0, clamp(300px, 42vh, 440px)) 102px minmax(340px, 390px);
        max-width: 1240px;
    }

    .is-watch-page .episode-sheet-panel {
        padding: 20px 18px 22px;
    }
}

@media (max-width: 1180px) and (min-width: 701px) {
    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar {
        min-height: 112px;
        flex-wrap: wrap;
        gap: 8px 18px;
        padding: 11px 28px 13px;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .brand {
        flex: 1 1 auto;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .auth-actions {
        margin-left: auto;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar .search {
        order: 4;
        width: 100%;
        flex: 1 0 100%;
        margin-left: 0;
    }
}

@media (max-width: 1060px) {
    .is-account-page .account-progress-grid,
    .is-admin-page .admin-user-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .is-detail-page .detail {
        grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
        gap: 36px;
    }
}

@media (max-width: 820px) and (min-width: 701px) {
    .detail-page-shell {
        padding-inline: 30px;
    }

    .is-detail-page .detail {
        grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
        align-items: center;
    }

    .is-detail-page .detail-poster {
        width: 100%;
    }

    .is-detail-page .detail-title,
    .is-detail-page .detail-description {
        text-align: left;
    }

    .is-detail-page .stats,
    .is-detail-page .tag-list {
        justify-content: flex-start;
    }

    .is-detail-page .detail-subtitle {
        text-align: left;
    }

    .detail-taxonomy {
        grid-template-columns: 1fr;
    }

    .is-admin-page .admin-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile shell for detail, history, and admin. */
@media (max-width: 700px) {
    body:is(.is-detail-page, .is-account-page, .is-admin-page) .page {
        padding-bottom: calc(88px + env(safe-area-inset-bottom));
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar {
        min-height: 102px;
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 9px 12px;
        padding: 10px 16px 11px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar .brand {
        width: auto;
        flex: 1 1 auto;
        order: 1;
        justify-content: flex-start;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar .brand h1 {
        display: block;
        font-size: 1.02rem;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar .brand .nav {
        display: none;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .brand-mark {
        width: 32px;
        height: 32px;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar .mobile-account-menu {
        display: block;
        order: 2;
        margin-left: auto;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-profile-menu summary,
    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-login-icon {
        width: 34px;
        height: 34px;
        border-color: var(--brand-border);
        background: #10203a;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar .search {
        order: 3;
        width: 100%;
        flex: 1 0 100%;
        margin: 0;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .search input {
        min-height: 38px;
        background: #0b182c;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar .auth-actions {
        display: none;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .topbar .mobile-nav-row {
        position: fixed;
        z-index: 100;
        right: 0;
        bottom: 0;
        left: 0;
        order: 4;
        width: 100%;
        min-height: calc(64px + env(safe-area-inset-bottom));
        display: flex;
        gap: 0;
        padding: 5px 10px env(safe-area-inset-bottom);
        border-top: 1px solid rgba(98, 164, 245, .14);
        background: rgba(5, 12, 24, .97);
        box-shadow: 0 -10px 28px rgba(0, 0, 0, .36);
        backdrop-filter: blur(16px);
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-nav-row a,
    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-nav-row button {
        min-height: 54px;
        flex: 1;
        flex-direction: column;
        gap: 3px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #71829a;
        font-size: .65rem;
        font-weight: 700;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-nav-row button {
        width: auto;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-nav-row a i,
    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-nav-row button i {
        font-size: 1.05rem;
    }

    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-nav-row a.active,
    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-nav-row a:hover,
    body:is(.is-detail-page, .is-account-page, .is-admin-page) .mobile-nav-row button:hover {
        background: transparent;
        color: #fff;
    }

    .detail-page-shell {
        min-height: 0;
        padding: 22px 18px 54px;
    }

    .detail-backdrop::before {
        background-position: center 12%;
        opacity: .26;
    }

    .detail-backdrop::after {
        background: linear-gradient(0deg, #050a14 0%, rgba(5, 10, 20, .9) 66%, rgba(5, 10, 20, .58) 100%);
    }

    .is-detail-page .back-link {
        min-height: 34px;
        display: inline-flex;
        margin-bottom: 20px;
        font-size: .74rem;
    }

    .is-detail-page .detail {
        grid-template-columns: 1fr;
        gap: 25px;
        min-height: 0;
    }

    .is-detail-page .detail-media {
        display: flex;
        justify-content: center;
    }

    .is-detail-page .detail-poster {
        width: min(238px, 70vw);
        border-radius: 14px;
    }

    .detail-copy {
        max-width: none;
        text-align: center;
    }

    .detail-kicker {
        justify-content: center;
        font-size: .65rem;
    }

    .is-detail-page .detail-title {
        font-size: clamp(2.2rem, 11vw, 3.2rem);
        text-align: center;
    }

    .is-detail-page .stats,
    .is-detail-page .tag-list,
    .detail-actions {
        justify-content: center;
    }

    .is-detail-page .watch {
        width: min(310px, 100%);
    }

    .is-detail-page .watch-progress-note,
    .is-detail-page .detail-description,
    .is-detail-page .detail-subtitle {
        text-align: center;
    }

    .detail-taxonomy {
        grid-template-columns: 1fr;
        margin-top: 24px;
    }

    .is-account-page .account-page,
    .is-admin-page .admin-page {
        width: calc(100% - 32px);
        padding-top: 26px;
    }

    .is-account-page .account-heading,
    .is-admin-page .admin-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .is-account-page .account-heading {
        min-height: 0;
        gap: 18px;
        padding: 22px;
        border-radius: 14px;
    }

    .account-heading-main,
    .admin-heading-main {
        align-items: flex-start;
        gap: 13px;
    }

    .account-heading-icon,
    .admin-heading-icon {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 13px;
        font-size: 1.05rem;
    }

    .is-account-page .account-heading h2,
    .is-admin-page .admin-heading h2 {
        font-size: 2rem;
    }

    .account-heading-copy,
    .admin-heading-copy {
        font-size: .78rem;
        line-height: 1.5;
    }

    .is-account-page .account-progress-grid,
    .is-admin-page .admin-user-grid,
    .is-admin-page .admin-stat-grid {
        grid-template-columns: 1fr;
    }

    .is-account-page .account-progress-card {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 13px;
    }

    .is-account-page .account-progress-thumb {
        width: 88px;
    }

    .is-admin-page .admin-stat-card {
        min-height: 94px;
    }

    .is-admin-page .admin-filters {
        grid-template-columns: 1fr;
    }

    .is-admin-page .admin-user-main,
    .is-admin-page .admin-user-meta,
    .is-admin-page .admin-facts div,
    .is-admin-page .admin-history-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .is-admin-page .admin-user-card-side {
        position: absolute;
        top: 14px;
        right: 14px;
    }

    .is-admin-page .admin-user-card {
        position: relative;
    }

    .is-admin-page .admin-subscription-text,
    .is-admin-page .admin-facts dd {
        text-align: left;
    }

    .is-admin-page .admin-detail-grid,
    .is-admin-page .admin-action-grid,
    .is-admin-page .admin-form {
        grid-template-columns: 1fr;
    }

    .episode-current-chip > span {
        display: none;
    }
}

@media (max-width: 820px) {
    .is-watch-page .watch-ambient {
        display: none;
    }

    .is-watch-page .reels-frame {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .is-watch-page .topbar {
        border-bottom: 0;
        background: linear-gradient(180deg, rgba(2, 8, 18, .82), transparent);
    }

    .is-watch-page .episode-sheet-panel {
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 20px 20px 0 0;
        background:
            radial-gradient(circle at 90% 0, rgba(79, 195, 255, .12), transparent 15rem),
            rgba(7, 17, 33, .99);
    }
}

@media (prefers-reduced-motion: reduce) {
    body:is(.is-detail-page, .is-account-page, .is-admin-page, .is-watch-page) *,
    body:is(.is-detail-page, .is-account-page, .is-admin-page, .is-watch-page) *::before,
    body:is(.is-detail-page, .is-account-page, .is-admin-page, .is-watch-page) *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
