:root {
    --library-accent: #7c5cff;
    --library-surface: #171922;
    --library-surface-2: #20232f;
    --library-border: rgba(255, 255, 255, .09);
    --library-bg: #0c0e14;
    --library-text: #f5f6fb;
    --library-muted: #b3b8c7;
    --library-input: #11131a;
    --library-nav: rgba(23, 25, 34, .9);
    --library-dropdown-bg: #1d202b;
    --library-card-count: #b1b6c5;
}

html, body { max-width: 100%; overflow-x: clip; }

body {
    min-height: 100vh;
    background: radial-gradient(circle at 12% 0, rgba(124, 92, 255, .2), transparent 30rem),
        radial-gradient(circle at 90% 8%, rgba(24, 200, 255, .1), transparent 26rem), var(--library-bg);
    color: var(--library-text);
}

.library-shell { width: 100%; max-width: 1180px; overflow: visible; }
.library-eyebrow { color: #9c8bff; font-size: .72rem; font-weight: 800; letter-spacing: .18em; }
.library-header { padding: 1rem 0; }
.library-nav { padding: .4rem; border: 1px solid var(--library-border); border-radius: 1rem; background: rgba(23, 25, 34, .78); backdrop-filter: blur(14px); }
.library-nav .nav-link { min-width: 7.5rem; color: #aeb3c2; text-align: center; border-radius: .7rem; }
.library-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.library-nav .nav-link.active { color: #fff !important; background: linear-gradient(135deg, #7657f5, #267bdc) !important; box-shadow: 0 .45rem 1.4rem rgba(75, 87, 220, .32); }
.library-search { display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem .55rem 1rem; border: 1px solid var(--library-border); border-radius: .9rem; background: rgba(17,19,26,.88); }
.library-search input { min-width: 10rem; flex: 1; border: 0; outline: 0; color: #fff; background: transparent; }
.library-search input::placeholder { color: #777e91; }
.library-search select { max-width: 11rem; padding: .42rem 1.8rem .42rem .65rem; border: 1px solid var(--library-border); border-radius: .55rem; color: #d9dce5; background: #191c25; }
.library-search a { color: #9ca2b4; font-size: 1.4rem; line-height: 1; text-decoration: none; }
.library-search button { padding: .42rem .9rem; border: 0; border-radius: .6rem; color: #fff; background: linear-gradient(135deg, var(--library-accent), #5a78ff); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1.1rem; }
.video-grid > * { min-width: 0; max-width: 100%; }
.video-card { position: relative; min-width: 0; max-width: 100%; border: 1px solid var(--library-border); border-radius: 1rem; background: linear-gradient(160deg, var(--library-surface-2), var(--library-surface)); box-shadow: 0 .7rem 2rem rgba(0, 0, 0, .2); transition: transform .18s ease, border-color .18s ease; }
.video-card:hover { transform: translateY(-3px); border-color: rgba(124, 92, 255, .55); }
.video-cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 1rem 1rem 0 0; background: linear-gradient(135deg, #282c3a, #12141c); }
.video-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.video-card:hover .video-cover img { transform: scale(1.035); }
.video-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #747b91; font-size: 2rem; }
.video-play { position: absolute; left: 50%; top: 50%; display: grid; width: 3rem; height: 3rem; place-items: center; border-radius: 50%; color: white; background: rgba(10, 11, 17, .72); transform: translate(-50%, -50%); backdrop-filter: blur(7px); }
.video-body { min-width: 0; overflow: hidden; padding: 1rem; }
.video-title { display: -webkit-box; overflow: hidden; color: #f5f6fb; font-size: 1rem; line-height: 1.35; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.video-title:hover { color: #a998ff; }
.site-badge { display: inline-flex; margin-top: .55rem; padding: .23rem .55rem; border-radius: 999px; color: #aeb3c2; background: rgba(255, 255, 255, .06); font-size: .72rem; }
.video-actions { display: grid; gap: .55rem; margin-top: 1rem; }
.playlist-picker { display: grid; width: 100%; max-width: 100%; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; }
.playlist-picker .form-select { min-width: 0; max-width: 100%; }
.card-controls { position: absolute; z-index: 5; top: .55rem; right: .55rem; display: flex; gap: .4rem; }
.selection-check { position: absolute; z-index: 6; top: .65rem; left: .65rem; display: none; cursor: pointer; }
.selection-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.selection-check span { display: grid; width: 2.2rem; height: 2.2rem; place-items: center; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; color: transparent; background: rgba(10,11,17,.7); box-shadow: 0 .2rem .7rem rgba(0,0,0,.25); }
.selection-check input:focus-visible + span { outline: 3px solid rgba(124,92,255,.45); outline-offset: 2px; }
.selection-check input:checked + span { color: #fff; border-color: #8c78ff; background: #684fd7; }
.selection-mode .selection-check { display: block; }
.selection-mode .card-controls { display: none; }
.selection-mode .video-card { cursor: pointer; }
.video-card.is-selected { border-color: #8b74ff; box-shadow: 0 0 0 3px rgba(124,92,255,.38), 0 .9rem 2.2rem rgba(0,0,0,.28); transform: translateY(-3px); }
.selection-toolbar { position: sticky; z-index: 30; top: .75rem; margin-bottom: 1rem; padding: .75rem; border: 1px solid rgba(139,116,255,.55); border-radius: .9rem; background: rgba(28,27,43,.94); box-shadow: 0 .8rem 2rem rgba(0,0,0,.3); backdrop-filter: blur(14px); }
.selection-toolbar[hidden] { display: none; }
.selection-actions { display: flex; min-width: 0; max-width: 100%; flex-wrap: wrap; align-items: center; gap: .55rem; }
.selection-actions strong { margin-right: auto; color: #fff; }
.selection-actions .form-select { width: auto; min-width: 10rem; }
.icon-button { display: grid; min-width: 2.25rem; height: 2.25rem; padding: 0 .55rem; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: #fff; background: rgba(10,11,17,.78); box-shadow: 0 .25rem .8rem rgba(0,0,0,.25); font-size: 1rem; font-weight: 800; line-height: 1; backdrop-filter: blur(8px); }
.icon-button:hover { border-color: rgba(255,255,255,.35); background: #242735; }
.icon-button-danger { color: #ff9aa8; font-size: 1.55rem; font-weight: 400; }
.icon-button-danger:hover { color: #fff; border-color: #dc3545; background: #b02a37; }
.action-menu { position: relative; }
.action-menu summary { list-style: none; cursor: pointer; }
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu[open] > summary { border-color: #8c78ff; background: #292c3b; }
.library-dropdown { position: absolute; z-index: 20; top: calc(100% + .45rem); right: 0; width: min(20rem, calc(100vw - 2rem)); max-width: calc(100vw - 2rem); border: 1px solid var(--library-border); border-radius: .8rem; color: #fff; background: #1d202b; box-shadow: 0 1rem 2.5rem rgba(0,0,0,.45); }
.video-info-line { display: flex; overflow: hidden; align-items: center; gap: .35rem; margin-top: .65rem; color: #9299aa; font-size: .74rem; white-space: nowrap; }
.video-info-line i { color: #555d70; font-style: normal; }
.video-info-line strong { color: #c9c1ff; }
.video-info-line .performer { color: #91d9ed; }
.video-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; color: #b8bdca; font-size: .78rem; }
.video-meta span { padding: .22rem .48rem; border-radius: .4rem; background: rgba(255,255,255,.055); }
.video-meta .quality-badge { color: #d8d1ff; background: rgba(124,92,255,.18); }
.pornstar-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.pornstar-list span { padding: .2rem .48rem; border: 1px solid rgba(24,200,255,.14); border-radius: 999px; color: #9bdff3; background: rgba(24,200,255,.06); font-size: .72rem; }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.playlist-grid > * { min-width: 0; max-width: 100%; }
.playlist-card { position: relative; min-height: 8.5rem; border: 1px solid var(--library-border); border-radius: 1rem; background: linear-gradient(145deg, #202432, #151720); transition: transform .18s ease, border-color .18s ease; }
.playlist-card:hover { transform: translateY(-3px); border-color: rgba(124,92,255,.55); }
.playlist-card-link { display: flex; height: 100%; align-items: center; gap: 1rem; padding: 1.25rem 3.6rem 1.25rem 1.25rem; color: #fff; text-decoration: none; }
.playlist-card-link strong { display: block; overflow-wrap: anywhere; }
.playlist-card-link small { display: block; margin-top: .3rem; color: #8f95a7; }
.playlist-icon { display: grid; flex: 0 0 3.2rem; height: 3.2rem; place-items: center; border-radius: .85rem; color: #c9c1ff; background: linear-gradient(135deg, rgba(124,92,255,.3), rgba(24,200,255,.12)); }
.playlist-preview { display: grid; flex: 0 0 5.5rem; height: 3.5rem; overflow: hidden; place-items: center; border-radius: .7rem; background: linear-gradient(135deg, rgba(124,92,255,.3), rgba(24,200,255,.12)); }
.playlist-preview img { width: 100%; height: 100%; object-fit: cover; }
.playlist-preview .playlist-icon { width: 100%; height: 100%; border-radius: 0; }
.playlist-menu { position: absolute; z-index: 4; top: .75rem; right: .75rem; }
.action-menu.playlist-menu { position: absolute; }
.playlist-panel, .create-panel { border: 1px solid var(--library-border); border-radius: 1rem; background: rgba(23, 25, 34, .9); box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .18); }
.playlist-panel { overflow: hidden; }
.playlist-heading { padding: 1rem; background: linear-gradient(100deg, rgba(124, 92, 255, .13), transparent); }
.playlist-videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; padding: 1rem; }
.playlist-video { display: grid; grid-template-columns: 7rem minmax(0, 1fr); overflow: hidden; border: 1px solid var(--library-border); border-radius: .75rem; background: rgba(255, 255, 255, .025); }
.playlist-video .video-cover { aspect-ratio: auto; min-height: 5.2rem; }
.playlist-video-content { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; padding: .65rem; }
.empty-state { padding: 4rem 1rem; border: 1px dashed rgba(255, 255, 255, .15); border-radius: 1rem; color: #858b9e; text-align: center; background: rgba(255, 255, 255, .02); }
.form-control, .form-select { border-color: var(--library-border); background-color: #11131a; color: #f3f4f8; }
.form-control:focus, .form-select:focus { border-color: var(--library-accent); background-color: #11131a; color: #fff; box-shadow: 0 0 0 .2rem rgba(124, 92, 255, .17); }

.theme-toggle { display: inline-flex; min-width: 5.8rem; align-items: center; justify-content: center; gap: .4rem; }
.library-header .btn-outline-secondary { color: #eef0f7; border-color: #747b90; background: rgba(255,255,255,.055); }
.library-header .btn-outline-secondary:hover { color: #fff; border-color: #8a78ef; background: #5f49c7; }
.text-secondary { color: var(--library-muted) !important; }
.library-nav { background: var(--library-nav); }
.library-search { background: var(--library-input); }
.library-search input { color: var(--library-text); }
.library-search input::placeholder { color: var(--library-muted); opacity: .72; }
.library-search select { color: var(--library-text); background: var(--library-surface); }
.video-title, .playlist-card-link { color: var(--library-text); }
.video-info-line { color: var(--library-muted); }
.video-info-line i { color: var(--library-muted); opacity: .58; }
.playlist-card-link small { color: var(--library-card-count); }
.library-dropdown { color: var(--library-text); background: var(--library-dropdown-bg); }
.form-control, .form-select { color: var(--library-text); background-color: var(--library-input); }
.form-control:focus, .form-select:focus { color: var(--library-text); background-color: var(--library-input); }
.library-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.library-pagination .pagination { margin: 0; gap: .3rem; }
.library-pagination .page-link { min-width: 2.35rem; border: 1px solid var(--library-border); border-radius: .55rem !important; color: var(--library-text); text-align: center; background: var(--library-surface); }
.library-pagination .page-link:hover { color: #fff; border-color: #7657f5; background: #6650d1; }
.library-pagination .page-item.active .page-link { color: #fff !important; border-color: transparent; background: linear-gradient(135deg, #7657f5, #267bdc); }
.library-pagination .page-item.disabled .page-link { color: var(--library-muted); background: var(--library-surface); opacity: .55; }
.page-jump { display: flex; align-items: center; gap: .45rem; color: var(--library-muted); font-size: .85rem; }
.page-jump input { width: 4rem; padding: .38rem .45rem; border: 1px solid var(--library-border); border-radius: .5rem; color: var(--library-text); text-align: center; background: var(--library-input); }
.page-jump button { padding: .4rem .7rem; border: 0; border-radius: .5rem; color: #fff; background: #6650d1; }

[data-bs-theme="light"] {
    --library-accent: #6346df;
    --library-surface: #ffffff;
    --library-surface-2: #f4f2fb;
    --library-border: rgba(35, 29, 67, .14);
    --library-bg: #f6f7fb;
    --library-text: #211d30;
    --library-muted: #5f6472;
    --library-input: #ffffff;
    --library-nav: rgba(255, 255, 255, .9);
    --library-dropdown-bg: #ffffff;
    --library-card-count: #5c6170;
}

[data-bs-theme="light"] body {
    background: radial-gradient(circle at 12% 0, rgba(124, 92, 255, .13), transparent 30rem),
        radial-gradient(circle at 90% 8%, rgba(24, 200, 255, .1), transparent 26rem), var(--library-bg);
}

[data-bs-theme="light"] .library-eyebrow { color: #5d42cf; }
[data-bs-theme="light"] .library-nav .nav-link { color: #555b69; }
[data-bs-theme="light"] .library-nav .nav-link:hover { color: #211d30; background: rgba(65, 50, 125, .07); }
[data-bs-theme="light"] .video-card,
[data-bs-theme="light"] .playlist-card { box-shadow: 0 .7rem 2rem rgba(42, 34, 77, .09); }
[data-bs-theme="light"] .playlist-card { background: linear-gradient(145deg, #fff, #f2f0f9); }
[data-bs-theme="light"] .create-panel,
[data-bs-theme="light"] .playlist-panel { background: rgba(255, 255, 255, .94); box-shadow: 0 .8rem 2rem rgba(42, 34, 77, .08); }
[data-bs-theme="light"] .video-info-line strong { color: #6248c9; }
[data-bs-theme="light"] .video-info-line .performer { color: #087b9b; }
[data-bs-theme="light"] .playlist-icon { color: #553bc5; }
[data-bs-theme="light"] .empty-state { color: #626776; background: rgba(255, 255, 255, .55); }
[data-bs-theme="light"] .library-search a { color: #555b69; }
[data-bs-theme="light"] .btn-outline-secondary { --bs-btn-color: #4f5360; --bs-btn-border-color: #777d8b; --bs-btn-hover-bg: #4f5360; --bs-btn-hover-border-color: #4f5360; }
[data-bs-theme="light"] .library-header .btn-outline-secondary { color: #3f4350; border-color: #777d8b; background: rgba(255,255,255,.78); }
[data-bs-theme="light"] .library-header .btn-outline-secondary:hover { color: #fff; border-color: #6049ca; background: #6049ca; }
[data-bs-theme="light"] .selection-toolbar { background: rgba(255,255,255,.96); box-shadow: 0 .8rem 2rem rgba(42,34,77,.14); }
[data-bs-theme="light"] .selection-actions strong { color: #29243a; }
[data-bs-theme="light"] .selection-actions .btn-outline-light { color: #4c465e; border-color: #777083; }

.account-overview, .account-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--library-border);
    border-radius: 1rem;
    background: linear-gradient(145deg, var(--library-surface-2), var(--library-surface));
    box-shadow: 0 .7rem 2rem rgba(0, 0, 0, .16);
}
.account-overview > div { display: flex; flex-direction: column; }
.account-label { color: var(--library-muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.account-status-card { display: block; margin-bottom: 1rem; }
.account-status-card p:last-of-type { margin-bottom: 0; }
.account-status-card p, .account-status-card strong { color: var(--library-text); }
.account-status-card .pro { color: #37e7a0 !important; font-weight: 700; }
.account-status-card .text-info { color: #65d9f3 !important; font-weight: 700; }
.account-status-card .text-success { color: #55dda1 !important; font-weight: 700; }
.account-page .accordion { display: grid; gap: .75rem; }
.account-page .accordion-item { overflow: hidden; border: 1px solid var(--library-border); border-radius: 1rem !important; background: var(--library-surface); box-shadow: 0 .55rem 1.6rem rgba(0,0,0,.12); }
.account-page .accordion-button { padding: 1rem 1.15rem; color: var(--library-text); background: var(--library-surface); box-shadow: none; }
.account-page .accordion-button:hover { background: var(--library-surface-2); }
.account-page .accordion-button:not(.collapsed) { color: #fff; background: linear-gradient(135deg, #684fd7, #3576c8); box-shadow: none; }
.account-page .accordion-button:not(.collapsed)::after { filter: brightness(0) invert(1); }
.account-page .accordion-body { color: var(--library-text); background: var(--library-surface); }
.account-page .card, .account-page .list-group-item, .account-page .table { color: var(--library-text); border-color: var(--library-border); background-color: var(--library-surface-2); }
.account-page .table > :not(caption) > * > * { color: var(--library-text); border-color: var(--library-border); background-color: transparent; }
.account-page .table thead, .account-page .table-dark { --bs-table-bg: #292d3a; --bs-table-color: #f7f8fb; }
.account-page .buy-pro-price > span, .account-page .buy-pro-price strong, .account-page #price { color: var(--library-text) !important; }
.account-page .support-section { background: linear-gradient(180deg, rgba(124,92,255,.08), transparent 14rem); }
.account-page .support-ticket { border-color: var(--library-border); background: var(--library-surface-2); }
.account-page .support-ticket-header, .account-page .support-reply-form { color: var(--library-text); border-color: var(--library-border); background: var(--library-surface); }
.account-page .support-conversation { background: color-mix(in srgb, var(--library-bg) 70%, var(--library-surface)); }
.account-page .support-message, .account-page .support-message div, .account-page .support-message-author { color: #fff !important; }
.account-page .support-message-user { background: #3b4050; }
.account-page .support-message-admin { background: linear-gradient(135deg, #087f5b, #096b50); }
.account-page .support-user-meta { color: var(--library-muted); }
.account-page .table-striped > tbody > tr:nth-of-type(odd) > * { color: var(--library-text); background-color: rgba(124,92,255,.045); }
.account-page .form-control, .account-page .form-select, .account-page textarea { border-color: var(--library-border); color: var(--library-text) !important; background: var(--library-input) !important; }
.account-page hr { border-color: var(--library-border); opacity: 1; }
.account-page a:not(.btn) { color: #9180ee; }

[data-bs-theme="light"] .account-overview,
[data-bs-theme="light"] .account-status-card,
[data-bs-theme="light"] .account-page .accordion-item { box-shadow: 0 .7rem 2rem rgba(42,34,77,.08); }
[data-bs-theme="light"] .account-page a:not(.btn) { color: #553abf; }
[data-bs-theme="light"] .account-status-card .pro { color: #087a52 !important; }
[data-bs-theme="light"] .account-status-card .text-info { color: #086b82 !important; }
[data-bs-theme="light"] .account-status-card .text-success { color: #087a52 !important; }
[data-bs-theme="light"] .account-page .table thead,
[data-bs-theme="light"] .account-page .table-dark { --bs-table-bg: #e7e3f4; --bs-table-color: #252130; }
[data-bs-theme="light"] .account-page .support-message-user { background: #485063; }

@media (max-width: 991.98px) {
    .playlist-videos { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
    .library-shell { padding-right: .75rem; padding-left: .75rem; }
    .library-nav { flex-wrap: nowrap; }
    .library-nav .nav-link { min-width: 0; flex: 1; padding-inline: .5rem; }
    .playlist-video { grid-template-columns: 5.5rem minmax(0, 1fr); }
    .library-search { flex-wrap: wrap; }
    .library-search > span { display: none; }
    .library-search-search input, .library-search input { flex-basis: calc(100% - 3rem); }
    .library-search select { max-width: none; flex: 1 1 calc(50% - .4rem); }
    .library-search button { flex: 1; }
    .selection-actions > * { min-width: 0; }
    .selection-actions .form-select { width: 100%; flex-basis: 100%; }
    .library-pagination nav { max-width: 100%; overflow-x: auto; padding-bottom: .25rem; }
    .account-overview { align-items: stretch; flex-direction: column; }
    .account-overview .btn { width: 100%; }
}
