:root {
    --bg: #090a0d;
    --surface: #111218;
    --surface-2: #191b22;
    --surface-3: #22242d;
    --text: #f7f7fa;
    --muted: #a4a6b0;
    --border: rgba(255,255,255,.1);
    --accent: #ff3158;
    --accent-2: #ff5f42;
    --accent-soft: rgba(255,49,88,.15);
    --success: #3ddc97;
    --danger: #ff5c72;
    --shadow: 0 20px 55px rgba(0,0,0,.28);
    --sidebar: 230px;
    --topbar: 68px;
    color-scheme: dark;
}

html[data-theme="light"] {
    --bg: #f7f7f9;
    --surface: #ffffff;
    --surface-2: #f0f1f4;
    --surface-3: #e6e7eb;
    --text: #111218;
    --muted: #656874;
    --border: rgba(18,20,27,.12);
    --accent-soft: rgba(255,49,88,.1);
    --shadow: 0 20px 55px rgba(40,42,52,.12);
    color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { letter-spacing: -.035em; }
button { color: inherit; }

.topbar { position: fixed; inset: 0 0 auto 0; height: var(--topbar); z-index: 50; display: flex; align-items: center; gap: 18px; padding: 0 22px; background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 155px; font-weight: 850; font-size: 1.2rem; letter-spacing: -.04em; }
.brand-logo { display: block; flex: 0 0 auto; width: 35px; height: 35px; filter: drop-shadow(0 7px 12px rgba(255,49,88,.24)); }
.brand-logo-large { width: 76px; height: 76px; }
.icon-button { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover { background: var(--surface-2); }
.menu-toggle { display: none; }
.top-search { display: flex; width: min(660px, 48vw); margin: 0 auto; }
.top-search input { width: 100%; min-width: 0; height: 42px; padding: 0 18px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 24px 0 0 24px; outline: 0; }
.top-search input:focus { border-color: rgba(255,49,88,.65); box-shadow: inset 0 0 0 1px rgba(255,49,88,.25); }
.top-search button { width: 58px; border: 1px solid var(--border); border-left: 0; border-radius: 0 24px 24px 0; background: var(--surface-2); cursor: pointer; font-size: 1.2rem; }
.top-actions { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 190px; }
.create-button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 15px; border-radius: 22px; background: var(--surface-2); font-weight: 700; }
.create-button:hover { background: var(--surface-3); }
.notification-link > span { position: absolute; top: 1px; right: -2px; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid var(--bg); border-radius: 10px; background: var(--accent); color: #fff; font-size: .62rem; line-height: 14px; text-align: center; }
.profile-trigger { display: inline-grid; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.profile-menu { position: absolute; top: 54px; right: 0; display: none; width: 270px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.profile-menu.open { display: block; }
.profile-menu a, .profile-menu form button { display: block; width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.profile-menu a:hover, .profile-menu form button:hover { background: var(--surface-2); }
.profile-summary { display: flex; align-items: center; gap: 11px; padding: 8px 8px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.profile-summary div { min-width: 0; }
.profile-summary strong, .profile-summary span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-summary span { color: var(--muted); font-size: .85rem; }

.app-shell { min-height: 100vh; padding-top: var(--topbar); }
.sidebar { position: fixed; inset: var(--topbar) auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--sidebar); padding: 16px 12px; overflow-y: auto; background: var(--bg); border-right: 1px solid transparent; }
.sidebar nav > a { display: flex; align-items: center; gap: 17px; min-height: 44px; padding: 8px 13px; border-radius: 10px; font-weight: 600; font-size: .93rem; }
.sidebar nav > a:hover { background: var(--surface-2); }
.sidebar nav > a span { width: 20px; font-size: 1.16rem; text-align: center; }
.sidebar hr { height: 1px; margin: 13px 4px; border: 0; background: var(--border); }
.sidebar-heading { display: block; padding: 4px 13px 8px; font-size: .88rem; }
.sidebar-signin { padding: 8px 13px; }
.sidebar-signin p { color: var(--muted); font-size: .86rem; }
.sidebar-footer { margin-top: auto; padding: 24px 12px 8px; color: var(--muted); font-size: .76rem; }
.sidebar-footer a { display: inline-block; margin: 0 8px 5px 0; font-weight: 650; }
.sidebar-footer p { margin: 12px 0 0; }
.sidebar-backdrop { display: none; }
.main-content { margin-left: var(--sidebar); padding: 30px clamp(18px,3vw,48px) 70px; min-width: 0; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 17px; border: 1px solid transparent; border-radius: 22px; font-weight: 750; cursor: pointer; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: linear-gradient(135deg,var(--accent),var(--accent-2)); box-shadow: 0 8px 22px rgba(255,49,88,.2); }
.button-primary:hover { box-shadow: 0 10px 30px rgba(255,49,88,.32); }
.button-secondary { background: var(--surface-2); border-color: var(--border); }
.button-outline { color: var(--accent); border-color: color-mix(in srgb,var(--accent) 50%,var(--border)); background: transparent; }
.button-ghost { background: transparent; }
.button-wide { width: 100%; }
.text-button { padding: 0; border: 0; background: none; color: var(--muted); font-weight: 700; cursor: pointer; }
.text-button:hover { color: var(--text); }
.danger { color: var(--danger) !important; }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 7px; color: var(--accent); font-weight: 800; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; }

.alert { max-width: 100%; margin: 0 0 18px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.alert-error { color: #ffbac5; border-color: rgba(255,92,114,.32); background: rgba(255,92,114,.1); }
.alert-success { color: #a4f3d0; border-color: rgba(61,220,151,.28); background: rgba(61,220,151,.1); }

.feed-header, .page-heading, .studio-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
.feed-header h1, .page-heading h1, .studio-heading h1 { margin: 0; font-size: clamp(2rem,4vw,3.2rem); }
.feed-header p, .page-heading p, .studio-heading p { margin-bottom: 0; color: var(--muted); }
.feed-tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); }
.feed-tabs a { padding: 8px 14px; border-radius: 18px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.feed-tabs a.active { color: #fff; background: var(--accent); }
.category-pills { display: flex; gap: 9px; margin-bottom: 28px; padding-bottom: 5px; overflow-x: auto; scrollbar-width: none; }
.category-pills::-webkit-scrollbar { display: none; }
.category-pills a { flex: 0 0 auto; padding: 7px 14px; border-radius: 10px; background: var(--surface-2); font-size: .88rem; font-weight: 700; }
.category-pills a:hover, .category-pills a.active { color: var(--bg); background: var(--text); }
.video-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 32px 18px; }
.video-card { min-width: 0; }
.thumbnail { position: relative; display: block; overflow: hidden; background: var(--surface-2); border-radius: 14px; aspect-ratio: 16/9; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.video-card:hover .thumbnail img, .compact-video:hover .thumbnail img { transform: scale(1.035); }
.duration { position: absolute; right: 7px; bottom: 7px; padding: 2px 5px; border-radius: 5px; background: rgba(0,0,0,.82); color: #fff; font-weight: 800; font-size: .72rem; }
.source-badge, .mature-badge { position: absolute; top: 8px; padding: 4px 7px; border-radius: 7px; color: #fff; background: rgba(9,10,13,.84); font-size: .67rem; font-weight: 850; letter-spacing: .02em; backdrop-filter: blur(8px); }
.source-badge { left: 8px; }
.mature-badge { right: 8px; color: #fff; background: rgba(255,49,88,.92); }
.adult-thumbnail img { filter: blur(14px) saturate(.65); transform: scale(1.08); }
.adult-confirmed .adult-thumbnail img { filter: none; transform: none; }
.adult-confirmed .video-card:hover .adult-thumbnail img, .adult-confirmed .compact-video:hover .adult-thumbnail img { transform: scale(1.035); }
.video-card-body { display: flex; gap: 11px; padding-top: 12px; }
.video-card-copy { min-width: 0; }
.video-card h3 { display: -webkit-box; margin: 0 0 5px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: .97rem; line-height: 1.38; }
.channel-name { color: var(--muted); font-size: .86rem; }
.channel-name:hover { color: var(--text); }
.video-card p, .compact-video p { margin: 2px 0 0; color: var(--muted); font-size: .81rem; }
.avatar { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.avatar-sm { width: 34px; height: 34px; }
.pagination { display: flex; justify-content: center; gap: 7px; margin-top: 45px; }
.page-link { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: var(--surface-2); font-weight: 700; }
.page-link.active { color: #fff; background: var(--accent); }
.empty-state { display: grid; place-items: center; min-height: 390px; padding: 45px 20px; text-align: center; border: 1px dashed var(--border); border-radius: 22px; background: linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--accent) 4%,var(--surface))); }
.empty-state > * { max-width: 510px; }
.empty-state h1, .empty-state h2, .empty-state h3 { margin: 0; }
.empty-state p { margin: 8px 0 20px; color: var(--muted); }
.empty-state.compact { min-height: 260px; border: 0; background: transparent; }
.empty-visual { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 24px; color: #fff; background: linear-gradient(135deg,var(--accent),var(--accent-2)); font-size: 1.7rem; box-shadow: 0 18px 50px rgba(255,49,88,.25); }
.empty-visual img { width: 72px; height: 72px; }
.featured-empty { min-height: 450px; }

.filter-bar { display: flex; gap: 9px; }
input, textarea, select { width: 100%; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; outline: 0; }
input, select { height: 45px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(255,49,88,.6); box-shadow: 0 0 0 3px rgba(255,49,88,.1); }
input:disabled { color: var(--muted); opacity: .8; }
label { display: grid; gap: 7px; font-weight: 700; font-size: .88rem; }
label small { color: var(--muted); font-weight: 500; }
.stack-form { display: grid; gap: 17px; }
.form-grid { display: grid; gap: 15px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; }
.checkbox-row input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.input-prefix span { padding-left: 13px; color: var(--muted); }
.input-prefix input { border: 0; background: transparent; box-shadow: none; }

.auth-layout { display: grid; grid-template-columns: 1.1fr minmax(360px,520px); min-height: calc(100vh - var(--topbar) - 100px); gap: 55px; align-items: center; max-width: 1150px; margin: auto; }
.auth-promo { padding: 50px; }
.auth-promo h1 { max-width: 650px; margin: 18px 0; font-size: clamp(3.5rem,7vw,6.5rem); line-height: .94; }
.auth-promo > p:not(.eyebrow) { max-width: 530px; color: var(--muted); font-size: 1.1rem; }
.promo-stats { display: flex; gap: 45px; margin-top: 45px; }
.promo-stats strong, .promo-stats span { display: block; }
.promo-stats strong { font-size: 1.8rem; }
.promo-stats span { color: var(--muted); font-size: .8rem; }
.auth-card { padding: clamp(25px,4vw,44px); border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card > p { color: var(--muted); }
.auth-switch { margin: 25px 0 0; text-align: center; }
.auth-switch a, .checkbox-row a { color: var(--accent); font-weight: 750; }

.watch-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,340px); gap: 24px; max-width: 1920px; margin: auto; }
.watch-primary { min-width: 0; }
.player-shell { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 16px; background: #000; box-shadow: 0 20px 70px rgba(0,0,0,.25); }
.player-shell video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.external-player-shell { position: relative; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 16/9; }
.external-player-shell iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: #000; }
.mature-player-shell { position: relative; }
.mature-player-shell:not(.mature-unlocked) > video, .mature-player-shell:not(.mature-unlocked) > iframe { visibility: hidden; }
.mature-gate { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; padding: 30px; background: radial-gradient(circle at 50% 0,rgba(255,49,88,.2),transparent 50%),#090a0d; text-align: center; }
.mature-gate[hidden] { display: none; }
.mature-gate > span { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 17px; border-radius: 50%; color: #fff; background: var(--accent); font-size: 1.25rem; font-weight: 900; }
.mature-gate h2 { margin: 0; color: #fff; }
.mature-gate p { max-width: 610px; margin: 8px 0 19px; color: #b8bac2; }
.mature-gate > a { margin-top: 12px; color: #b8bac2; font-size: .82rem; text-decoration: underline; }
.external-unavailable { display: grid; place-content: center; justify-items: center; width: 100%; height: 100%; min-height: 360px; padding: 30px; text-align: center; background: #090a0d; }
.external-unavailable > span { display: grid; place-items: center; width: 55px; height: 55px; margin-bottom: 15px; border-radius: 50%; color: #fff; background: var(--accent); font-size: 1.4rem; font-weight: 900; }
.external-unavailable h2 { margin: 0; color: #fff; }
.external-unavailable p { color: #b8bac2; }
.managed-ad-slot { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; text-align: center; }
.managed-ad-slot iframe, .managed-ad-slot img, .managed-ad-slot video { max-width: 100%; }
.managed-ad-global-top { margin: 0 auto 24px; }
.managed-ad-global-footer { margin: 45px auto 0; padding-top: 20px; border-top: 1px solid var(--border); }
.managed-ad-above-player { margin: 0 auto 16px; }
.managed-ad-watch-sidebar { margin: 0 auto 18px; }
.managed-video-overlay { position: absolute; right: 50%; bottom: 14px; z-index: 4; width: min(92%,730px); min-height: 50px; transform: translateX(50%); border: 1px solid rgba(255,255,255,.22); border-radius: 10px; background: rgba(8,9,12,.92); box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.managed-video-overlay > div { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 100%; min-height: 50px; overflow: hidden; }
.managed-video-overlay iframe, .managed-video-overlay img { max-width: 100%; }
.managed-video-overlay > button { position: absolute; top: -12px; right: -10px; z-index: 2; display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 2px solid #fff; border-radius: 50%; color: #fff; background: #17181e; font-size: 1rem; line-height: 1; cursor: pointer; }
.watch-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 17px 0 13px; }
.watch-title-row .watch-title { margin: 0; }
.external-source-link, .mature-inline-badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 12px; font-size: .72rem; font-weight: 800; }
.external-source-link { color: var(--muted); background: var(--surface-2); }
.mature-inline-badge { color: #fff; background: var(--accent); }
.watch-title { margin: 17px 0 13px; font-size: clamp(1.25rem,2.4vw,1.75rem); }
.watch-meta-row { display: flex; justify-content: space-between; gap: 15px; }
.channel-inline { display: flex; align-items: center; gap: 11px; min-width: 0; }
.channel-inline > div { min-width: max-content; }
.channel-title { display: block; font-weight: 800; }
.channel-inline span { color: var(--muted); font-size: .78rem; }
.channel-inline .button { margin-left: 8px; }
.watch-actions, .reaction-group { display: flex; align-items: center; gap: 7px; }
.reaction-group { gap: 0; overflow: hidden; border-radius: 22px; }
.reaction-group .action-pill { border-radius: 0; }
.reaction-group .action-pill + .action-pill { border-left-color: rgba(255,255,255,.16); }
.action-pill { min-height: 40px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface-2); font-weight: 750; cursor: pointer; }
.action-pill.active { color: #fff; background: var(--accent); }
.video-description { margin-top: 18px; padding: 15px 17px; border-radius: 14px; background: var(--surface-2); }
.description-meta { display: flex; flex-wrap: wrap; gap: 8px 13px; font-size: .85rem; }
.description-meta a { color: var(--accent); }
.description-copy { max-height: 75px; margin-top: 9px; overflow: hidden; font-size: .91rem; }
.video-description.expanded .description-copy { max-height: none; }
.video-description > button { margin-top: 8px; padding: 0; border: 0; background: none; font-weight: 800; cursor: pointer; }
.comments-section { margin-top: 30px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.section-title-row h2 { margin: 0; font-size: 1.25rem; }
.section-title-row > span { color: var(--muted); font-size: .86rem; }
.comment-form { display: flex; gap: 13px; margin-bottom: 30px; }
.comment-form > div { flex: 1; }
.comment-form textarea { border-width: 0 0 1px; border-radius: 0; background: transparent; }
.comment-form .form-actions { margin-top: 9px; }
.comment { display: flex; gap: 12px; margin-bottom: 24px; }
.comment > div { min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: .81rem; }
.comment-head a { font-weight: 800; }
.comment-head span { color: var(--muted); }
.comment p { margin: 5px 0; white-space: normal; overflow-wrap: anywhere; }
.signin-prompt { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 28px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.signin-prompt p { margin: 0; }
.watch-sidebar > h2 { margin-bottom: 14px; font-size: 1.05rem; }
.compact-video { display: grid; grid-template-columns: 168px 1fr; gap: 10px; margin-bottom: 12px; }
.compact-video .thumbnail { border-radius: 9px; }
.compact-video h3 { display: -webkit-box; margin: 0 0 5px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: .88rem; line-height: 1.35; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.modal[hidden] { display: none; }
.modal-card { width: min(460px,100%); max-height: 86vh; padding: 23px; overflow-y: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 0; }
.playlist-save-form { display: grid; gap: 12px; }
.quick-create-playlist { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }

.studio-heading { align-items: center; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 25px; }
.stat-grid article { padding: 21px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.stat-grid span, .stat-grid strong { display: block; }
.stat-grid span { color: var(--muted); font-size: .82rem; }
.stat-grid strong { margin-top: 7px; font-size: 1.7rem; }
.data-card, .details-card, .settings-card { border: 1px solid var(--border); border-radius: 17px; background: var(--surface); }
.data-card { overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head p { margin: 0; }
.card-head p, .card-head span { color: var(--muted); font-size: .84rem; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.table-video, .user-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.table-video img { width: 96px; aspect-ratio: 16/9; border-radius: 7px; object-fit: cover; }
.table-video div span, .user-cell div span { display: block; color: var(--muted); font-size: .76rem; }
.table-actions { display: flex; gap: 10px; }
.status-badge { display: inline-flex; padding: 4px 8px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 800; }
.status-public, .status-published, .status-active, .status-visible { color: var(--success); background: rgba(61,220,151,.11); }
.status-private, .status-hidden, .status-suspended { color: var(--danger); background: rgba(255,92,114,.11); }
.edit-video-form { max-width: 880px; margin: auto; padding: 28px; }
.edit-video-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.edit-video-preview img { width: 180px; aspect-ratio: 16/9; border-radius: 10px; object-fit: cover; }
.edit-video-preview strong, .edit-video-preview a { display: block; }
.edit-video-preview a { margin-top: 5px; color: var(--accent); font-size: .84rem; }
.upload-layout { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(400px,.95fr); gap: 20px; align-items: start; }
.upload-card { padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.source-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.source-option { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); cursor: pointer; }
.source-option.active { border-color: rgba(255,49,88,.65); box-shadow: inset 0 0 0 1px rgba(255,49,88,.24); background: var(--accent-soft); }
.source-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.source-option > span { grid-row: 1/3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); color: var(--accent); font-size: 1.15rem; }
.source-option strong, .source-option small { grid-column: 2; }
.source-option small { color: var(--muted); font-weight: 500; }
.external-source-panel { display: grid; place-items: center; min-height: 480px; padding: 42px; border: 2px dashed var(--border); border-radius: 14px; text-align: center; background: linear-gradient(145deg,var(--surface),var(--accent-soft)); }
.external-source-panel > h2 { margin: 12px 0 5px; }
.external-source-panel > p { max-width: 600px; color: var(--muted); }
.external-source-panel > label { width: min(680px,100%); margin: 18px 0; text-align: left; }
.external-source-panel textarea { min-height: 185px; line-height: 1.55; }
.external-link-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; color: #fff; background: linear-gradient(135deg,var(--accent),var(--accent-2)); font-size: 1.8rem; }
.provider-list { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; max-width: 680px; }
.provider-list span { padding: 5px 9px; border: 1px solid var(--border); border-radius: 15px; color: var(--muted); background: var(--surface); font-size: .72rem; font-weight: 700; }
.external-source-panel .source-note { margin: 18px 0 0; font-size: .78rem; }
.upload-only-fields { display: grid; gap: 18px; }
.bulk-import-notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid rgba(255,49,88,.28); border-radius: 12px; background: var(--accent-soft); }
.bulk-import-notice > span { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: linear-gradient(135deg,var(--accent),var(--accent-2)); font-size: 1.15rem; font-weight: 900; }
.bulk-import-notice strong, .bulk-import-notice small { display: block; }
.bulk-import-notice small { margin-top: 3px; color: var(--muted); font-size: .77rem; }
.mature-checkbox { padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.mature-checkbox span strong, .mature-checkbox span small { display: block; }
.mature-checkbox span small { margin-top: 3px; }
.auto-thumbnail-preview, .adult-content-notice { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.auto-thumbnail-preview[hidden] { display: none; }
.auto-thumbnail-preview img { width: 132px; aspect-ratio: 16/9; border-radius: 8px; object-fit: cover; background: var(--surface-3); }
.auto-thumbnail-preview strong, .auto-thumbnail-preview small, .adult-content-notice strong, .adult-content-notice small { display: block; }
.auto-thumbnail-preview small, .adult-content-notice small { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.adult-content-notice > span { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; color: #fff; background: var(--accent); font-size: .8rem; font-weight: 900; }
.dropzone { display: grid; place-items: center; min-height: 480px; padding: 35px; border: 2px dashed var(--border); border-radius: 14px; text-align: center; background: linear-gradient(145deg,var(--surface),var(--accent-soft)); cursor: pointer; }
.dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone > span:not(.upload-icon) { color: var(--muted); font-weight: 500; }
.dropzone .button { margin-top: 20px; pointer-events: none; }
.upload-icon { display: grid; place-items: center; width: 75px; height: 75px; margin-bottom: 16px; border-radius: 50%; color: #fff; background: linear-gradient(135deg,var(--accent),var(--accent-2)); font-size: 2rem; }
.upload-progress { margin-top: 15px; }
.upload-progress > div { overflow: hidden; height: 7px; border-radius: 6px; background: var(--surface-3); }
.upload-progress > div span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--accent),var(--accent-2)); }
.upload-progress p { margin: 7px 0 0; color: var(--muted); font-size: .8rem; }
.import-progress { width: min(680px,100%); margin-top: 18px; text-align: left; }
.details-card { display: grid; gap: 18px; padding: 25px; }
.details-card h2 { margin: 0; }

.channel-banner { overflow: hidden; height: clamp(180px,24vw,360px); border-radius: 18px; background: var(--surface-2); }
.channel-banner img { width: 100%; height: 100%; object-fit: cover; }
.banner-pattern { display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(circle at 70% 10%,rgba(255,95,66,.32),transparent 32%),radial-gradient(circle at 20% 80%,rgba(255,49,88,.26),transparent 36%),linear-gradient(135deg,#1a1020,#12131b); }
.banner-pattern img { width: 112px; height: 112px; opacity: .14; filter: grayscale(1) brightness(2); }
.channel-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 24px 22px; }
.channel-avatar { width: 116px; height: 116px; border: 4px solid var(--bg); border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.channel-avatar.small { width: 82px; height: 82px; }
.channel-info h1 { margin: 0; font-size: 2rem; }
.channel-info > p, .channel-bio { margin: 4px 0; color: var(--muted); font-size: .88rem; }
.channel-buttons { display: flex; gap: 9px; }
.channel-tabs { display: flex; gap: 30px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.channel-tabs a { padding: 14px 4px; color: var(--muted); font-weight: 700; }
.channel-tabs a.active { color: var(--text); border-bottom: 2px solid var(--accent); }
.channel-section { padding: 28px 0; }
.channel-about { padding: 30px 0; border-top: 1px solid var(--border); }
.channel-about > div { display: grid; grid-template-columns: minmax(0,2fr) minmax(220px,1fr); gap: 60px; }
.channel-about aside { display: grid; align-content: start; gap: 10px; }
.channel-about aside span { padding-bottom: 9px; color: var(--muted); border-bottom: 1px solid var(--border); }
.channel-chip-row { display: flex; gap: 20px; margin-bottom: 30px; padding-bottom: 8px; overflow-x: auto; }
.channel-chip-row a { display: grid; place-items: center; min-width: 86px; gap: 7px; text-align: center; font-size: .8rem; font-weight: 700; }
.channel-chip-row .avatar { width: 66px; height: 66px; }

.playlist-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px 17px; }
.playlist-cover { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; border-radius: 13px; background: var(--surface-2); }
.playlist-cover img { width: 100%; height: 100%; object-fit: cover; }
.playlist-cover span { position: absolute; right: 8px; bottom: 8px; padding: 4px 8px; border-radius: 7px; color: #fff; background: rgba(0,0,0,.8); font-size: .76rem; font-weight: 800; }
.playlist-card h2 { margin: 10px 0 2px; font-size: 1rem; }
.playlist-card p { margin-bottom: 5px; color: var(--muted); font-size: .8rem; }
.playlist-page { display: grid; grid-template-columns: minmax(300px,380px) 1fr; gap: 30px; align-items: start; }
.playlist-hero { position: sticky; top: calc(var(--topbar) + 24px); padding: 20px; border: 1px solid var(--border); border-radius: 19px; background: linear-gradient(160deg,var(--surface-3),var(--surface)); }
.playlist-hero-cover { position: relative; overflow: hidden; border-radius: 12px; aspect-ratio: 16/9; }
.playlist-hero-cover > img { width: 100%; height: 100%; object-fit: cover; }
.playlist-hero h1 { margin-bottom: 8px; }
.playlist-hero > div { padding: 18px 5px 3px; }
.playlist-hero p { color: var(--muted); font-size: .87rem; }
.playlist-owner { display: flex; align-items: center; gap: 9px; margin: 16px 0 7px; font-weight: 750; }
.playlist-items { display: grid; gap: 8px; }
.playlist-item { display: grid; grid-template-columns: 24px 180px 1fr auto; gap: 13px; align-items: center; padding: 8px; border-radius: 12px; }
.playlist-item:hover { background: var(--surface-2); }
.playlist-item .thumbnail { border-radius: 8px; }
.playlist-item h2 { margin: 0 0 4px; font-size: .95rem; }
.playlist-item p { margin: 3px 0 0; color: var(--muted); font-size: .77rem; }

.notification-list { max-width: 900px; }
.notification-item { display: flex; align-items: center; gap: 15px; padding: 15px; border-bottom: 1px solid var(--border); border-radius: 12px; }
.notification-item:hover, .notification-item.unread { background: var(--surface); }
.notification-item.unread { border-left: 3px solid var(--accent); }
.notification-item p { margin: 0; }
.notification-item span { color: var(--muted); font-size: .8rem; }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0,820px); gap: 28px; }
.settings-nav { display: grid; align-content: start; gap: 5px; }
.settings-nav a { padding: 11px 13px; border-radius: 9px; color: var(--muted); font-weight: 700; }
.settings-nav a:hover, .settings-nav a.active { color: var(--text); background: var(--surface-2); }
.settings-content { display: grid; gap: 25px; }
.settings-card > form { padding: 24px; }
.password-form { max-width: 520px; }
.current-branding { display: grid; grid-template-columns: 130px 1fr; gap: 20px; align-items: center; }
.current-branding > div > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .78rem; }
.banner-mini { display: grid; place-items: center; height: 105px; overflow: hidden; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.banner-mini img { width: 100%; height: 100%; object-fit: cover; }

.admin-tabs { display: flex; gap: 7px; margin-bottom: 14px; }
.admin-tabs button { padding: 9px 16px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); cursor: pointer; }
.admin-tabs button.active { color: #fff; border-color: var(--accent); background: var(--accent); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.comment-preview { max-width: 330px; }
.code-manager-panel { overflow: visible; }
.code-manager-warning { margin: 22px; padding: 15px 17px; border: 1px solid rgba(255,178,65,.28); border-radius: 12px; color: #ffd69a; background: rgba(255,178,65,.08); }
.code-manager-warning p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.code-manager-form { display: grid; gap: 15px; padding: 0 22px 22px; }
.code-manager-card { padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.code-manager-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 15px; }
.code-manager-head h3 { margin: 0 0 3px; }
.code-manager-head p { max-width: 700px; margin: 0; color: var(--muted); font-size: .83rem; }
.code-manager-card textarea { min-height: 150px; color: #d8f8e7; background: #090b0e; font-family: "SFMono-Regular",Consolas,"Liberation Mono",monospace; font-size: .78rem; line-height: 1.55; tab-size: 2; }
.switch-control { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; cursor: pointer; }
.switch-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-control > span { position: relative; width: 42px; height: 24px; border-radius: 14px; background: var(--surface-3); transition: .2s ease; }
.switch-control > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s ease; }
.switch-control input:checked + span { background: var(--accent); }
.switch-control input:checked + span::after { transform: translateX(18px); }
.switch-control strong { font-size: .78rem; }
.sticky-save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb,var(--surface) 92%,transparent); box-shadow: var(--shadow); backdrop-filter: blur(15px); }
.sticky-save-bar p { margin: 0; color: var(--muted); font-size: .82rem; }

.legal-page { max-width: 850px; margin: 20px auto; padding: clamp(25px,5vw,70px); border: 1px solid var(--border); border-radius: 22px; background: var(--surface); }
.legal-page > h1 { margin-bottom: 10px; font-size: clamp(2.5rem,5vw,4.5rem); }
.legal-lead { color: var(--muted); font-size: 1.15rem; }
.legal-content { margin-top: 45px; }
.legal-content h2 { margin: 30px 0 8px; }
.legal-content p { color: color-mix(in srgb,var(--text) 78%,var(--muted)); }
.legal-date { margin-top: 45px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; }

.installer-page { min-height: 100vh; background: radial-gradient(circle at 15% 0,rgba(255,49,88,.17),transparent 35%),var(--bg); }
.installer-shell { max-width: 1050px; margin: auto; padding: 45px 20px 80px; }
.installer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 60px; font-size: 1.2rem; }
.installer-intro { max-width: 760px; margin-bottom: 35px; }
.installer-intro h1 { margin-bottom: 15px; font-size: clamp(2.8rem,6vw,5.6rem); line-height: .96; }
.installer-intro > p:last-child { max-width: 600px; color: var(--muted); font-size: 1.08rem; }
.installer-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 20px; align-items: start; }
.installer-form h2 { margin: 10px 0 0; font-size: 1.1rem; }
.requirements-card { padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.requirements-card h2 { margin-bottom: 18px; }
.requirements-card > p { margin: 20px 0 0; color: var(--muted); font-size: .82rem; }
.requirement { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .86rem; }
.requirement span { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; font-weight: 900; }
.requirement.passed span { color: var(--success); background: rgba(61,220,151,.1); }
.requirement.failed span { color: var(--danger); background: rgba(255,92,114,.1); }
.install-success { max-width: 580px; margin: 10vh auto; text-align: center; }
.success-icon { display: grid; place-items: center; width: 75px; height: 75px; margin: 0 auto 20px; border-radius: 50%; color: var(--success); background: rgba(61,220,151,.12); font-size: 2rem; }
.fine-print { margin: 18px 0 0; font-size: .78rem; }
.toast-container { position: fixed; right: 22px; bottom: 22px; z-index: 150; display: grid; gap: 9px; width: min(360px,calc(100vw - 44px)); }
.toast { padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast.error { border-color: rgba(255,92,114,.4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1650px) {
    .watch-layout { display: block; max-width: 1180px; }
    .watch-sidebar { margin-top: 38px; }
    .compact-video { grid-template-columns: minmax(180px,260px) 1fr; max-width: 720px; }
}

@media (max-width: 1320px) {
    .video-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 1050px) {
    :root { --sidebar: 78px; }
    .sidebar { padding-inline: 8px; }
    .sidebar nav > a { justify-content: center; min-height: 58px; gap: 3px; padding: 7px 2px; flex-direction: column; font-size: .64rem; }
    .sidebar nav > a span { font-size: 1.15rem; }
    .sidebar hr, .sidebar-heading, .sidebar-signin, .sidebar-footer { display: none; }
    .watch-layout { display: block; }
    .watch-sidebar { margin-top: 35px; }
    .compact-video { grid-template-columns: minmax(180px,260px) 1fr; max-width: 680px; }
    .upload-layout { grid-template-columns: 1fr; }
    .dropzone { min-height: 330px; }
    .playlist-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .auth-layout { grid-template-columns: .9fr minmax(340px,460px); gap: 25px; }
    .auth-promo { padding: 20px; }
}

@media (max-width: 780px) {
    :root { --topbar: 62px; --sidebar: 0px; }
    .topbar { gap: 9px; padding: 0 12px; }
    .menu-toggle { display: inline-grid; }
    .brand { min-width: auto; }
    .brand > span:last-child { display: none; }
    .top-search { width: auto; flex: 1; }
    .top-search input { padding-inline: 12px; }
    .top-actions { min-width: auto; }
    .theme-toggle, .create-label { display: none; }
    .create-button { width: 40px; padding: 0; justify-content: center; }
    .top-actions .button-outline { padding: 8px 12px; white-space: nowrap; }
    .sidebar { width: 240px; transform: translateX(-105%); transition: transform .25s ease; border-right-color: var(--border); box-shadow: var(--shadow); }
    .sidebar.open { transform: translateX(0); }
    .sidebar nav > a { justify-content: flex-start; min-height: 44px; padding: 8px 13px; flex-direction: row; gap: 17px; font-size: .91rem; }
    .sidebar hr, .sidebar-heading, .sidebar-signin, .sidebar-footer { display: block; }
    .sidebar-backdrop.open { position: fixed; inset: var(--topbar) 0 0; z-index: 35; display: block; background: rgba(0,0,0,.62); }
    .main-content { margin-left: 0; padding: 22px 14px 60px; }
    .video-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .feed-header, .page-heading, .studio-heading { align-items: flex-start; flex-direction: column; }
    .feed-tabs { width: 100%; overflow-x: auto; }
    .feed-tabs a { flex: 1; text-align: center; }
    .search-heading .filter-bar { width: 100%; }
    .filter-bar { flex-wrap: wrap; }
    .filter-bar select { width: calc(50% - 5px); }
    .watch-meta-row { align-items: flex-start; flex-direction: column; }
    .watch-actions { width: 100%; overflow-x: auto; }
    .channel-inline { width: 100%; }
    .channel-inline .button { margin-left: auto; }
    .channel-header { grid-template-columns: auto 1fr; padding-inline: 5px; }
    .channel-buttons { grid-column: 1/-1; }
    .channel-about > div { grid-template-columns: 1fr; gap: 25px; }
    .stat-grid { grid-template-columns: repeat(2,1fr); }
    .playlist-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .playlist-page { grid-template-columns: 1fr; }
    .playlist-hero { position: static; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { display: flex; overflow-x: auto; }
    .auth-layout { display: block; }
    .auth-promo { display: none; }
    .auth-card { max-width: 540px; margin: 20px auto; }
    .installer-grid { grid-template-columns: 1fr; }
    .code-manager-head { flex-direction: column; gap: 12px; }
    .sticky-save-bar { align-items: stretch; flex-direction: column; }
    .managed-video-overlay { bottom: 9px; width: 94%; }
    .installer-brand { margin-bottom: 35px; }
}

@media (max-width: 540px) {
    .top-search input::placeholder { color: transparent; }
    .top-search button { width: 44px; }
    .notification-link { display: none; }
    .video-grid { grid-template-columns: 1fr; gap: 28px; }
    .video-card h3 { font-size: 1rem; }
    .feed-header h1, .page-heading h1, .studio-heading h1 { font-size: 2.1rem; }
    .player-shell { width: calc(100% + 28px); margin-inline: -14px; border-radius: 0; }
    .mature-gate { padding: 12px; }
    .mature-gate > span { width: 46px; height: 46px; margin-bottom: 8px; font-size: .85rem; }
    .mature-gate h2 { font-size: 1rem; }
    .mature-gate p { margin: 4px 0 9px; font-size: .75rem; line-height: 1.25; }
    .mature-gate .button { min-height: 36px; padding: 7px 12px; font-size: .78rem; }
    .mature-gate > a { margin-top: 6px; font-size: .7rem; }
    .watch-title { font-size: 1.15rem; }
    .channel-inline > div { min-width: 0; }
    .channel-inline .button { padding-inline: 12px; }
    .action-pill { white-space: nowrap; }
    .compact-video { grid-template-columns: 43% 1fr; }
    .two-columns { grid-template-columns: 1fr; }
    .playlist-grid { grid-template-columns: 1fr; }
    .playlist-item { grid-template-columns: 18px 120px 1fr auto; gap: 8px; }
    .playlist-item p { display: none; }
    .channel-banner { margin-inline: -14px; border-radius: 0; }
    .channel-avatar { width: 84px; height: 84px; }
    .channel-info h1 { font-size: 1.45rem; }
    .channel-bio { display: none; }
    .current-branding { grid-template-columns: 1fr; }
    .upload-card { padding: 8px; }
    .dropzone { min-height: 270px; }
    .details-card, .edit-video-form { padding: 18px; }
    .quick-create-playlist { grid-template-columns: 1fr; }
    .signin-prompt { align-items: flex-start; flex-direction: column; gap: 10px; }
}
