:root {
    --yt-bg: #0f0f0f;
    --yt-bg-elevated: #181818;
    --yt-surface: #212121;
    --yt-chip: #272727;
    --yt-chip-hover: #3f3f3f;
    --yt-border: #303030;
    --yt-text: #f1f1f1;
    --yt-muted: #aaaaaa;
    --accent: #ff6b00;
    --accent-hover: #ff852d;
    --accent-rgb: 255, 107, 0;
    --header-height: 56px;
    --sidebar-width: 240px;
    --sidebar-mini: 72px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--yt-bg);
    color: var(--yt-text);
    font-family: "Roboto", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

button, input, textarea, select {
    font-family: inherit;
    color: inherit;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

/* Header */
.yt-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    gap: 16px;
}

.yt-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 170px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--yt-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.15s ease;
    flex-shrink: 0;
}

.icon-btn:hover {
    background-color: var(--yt-chip);
}

.mobile-only-btn {
    display: none;
}

.yt-logo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.5px;
    user-select: none;
}

.yt-logo-img {
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    border-radius: 4px;
}

.yt-logo-badge {
    width: 30px;
    height: 21px;
    border-radius: 6px;
    background: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.35);
}

.yt-logo-region {
    font-size: 10px;
    font-weight: 500;
    color: var(--yt-muted);
    align-self: flex-start;
    margin-top: 2px;
    margin-left: -2px;
}

/* Search Bar */
.yt-header-center {
    flex: 1;
    max-width: 660px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.yt-search-form {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    max-width: 590px;
}

.yt-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    height: 40px;
    background: #121212;
    border: 1px solid var(--yt-border);
    border-right: none;
    border-radius: 40px 0 0 40px;
    padding: 0 14px 0 16px;
    transition: border-color 0.15s;
}

.yt-search-input-wrap:focus-within {
    border-color: var(--accent);
}

.yt-search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--yt-text);
    font-size: 15px;
}

.yt-search-input::placeholder {
    color: #888;
}

.yt-search-clear {
    background: none;
    border: none;
    color: var(--yt-muted);
    cursor: pointer;
    display: none;
    padding: 4px;
}

.yt-search-btn {
    width: 64px;
    height: 40px;
    background: #222222;
    border: 1px solid var(--yt-border);
    border-radius: 0 40px 40px 0;
    color: var(--yt-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s;
}

.yt-search-btn:hover {
    background: #2c2c2c;
}

.yt-mic-btn {
    background: #181818;
}

.yt-mic-btn.listening {
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--accent);
    animation: pulseGlow 1.2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); }
}

.search-suggestions {
    position: absolute;
    top: 44px;
    left: 0;
    right: 64px;
    background: #212121;
    border: 1px solid #353535;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
    padding: 6px 0;
    display: none;
    z-index: 1200;
}

.search-suggestions.open {
    display: block;
}

.search-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
}

.search-suggest-item:hover {
    background: #333333;
}

/* Header Right */
.yt-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 170px;
    justify-content: flex-end;
}

.create-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px 0 10px;
    background: var(--yt-chip);
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--yt-text);
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.create-pill-btn:hover {
    background: var(--yt-chip-hover);
}

.create-pill-btn svg,
.create-pill-btn i {
    color: var(--accent);
}

.signin-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    border: 1px solid rgba(var(--accent-rgb), 0.55);
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s;
}

.signin-pill-btn:hover {
    background: rgba(var(--accent-rgb), 0.2);
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--yt-bg);
}

/* Dropdown Menus */
.dropdown-wrap {
    position: relative;
}

.dropdown-panel {
    position: absolute;
    top: 46px;
    right: 0;
    width: 300px;
    background: #212121;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(0,0,0,0.65);
    display: none;
    z-index: 1200;
    overflow: hidden;
}

.dropdown-panel.notif-panel {
    width: 380px;
    max-height: 480px;
    overflow-y: auto;
}

.dropdown-panel.open {
    display: block;
}

.dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--yt-text);
    cursor: pointer;
    transition: background-color 0.12s;
}

.dropdown-item:hover {
    background: #333;
}

.dropdown-divider {
    height: 1px;
    background: #333;
    margin: 6px 0;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}

.notif-item:hover { background: #2c2c2c; }
.notif-item.unread { background: rgba(var(--accent-rgb), 0.08); }

/* Avatars */
.avatar-img, .avatar-fallback {
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), #b33c00);
    color: #fff;
    user-select: none;
}

.avatar-xs { width: 24px; height: 24px; font-size: 11px; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 40px; height: 40px; font-size: 16px; }
.avatar-xl { width: 80px; height: 80px; font-size: 30px; }
.avatar-2xl { width: 120px; height: 120px; font-size: 44px; }

.verified-badge {
    display: inline-flex;
    align-items: center;
    color: var(--yt-muted);
    margin-left: 4px;
    vertical-align: middle;
}

.verified-badge.accent {
    color: var(--accent);
}

/* App Shell & Sidebar */
.app-shell {
    padding-top: var(--header-height);
    min-height: 100vh;
}

.yt-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--yt-bg);
    overflow-y: auto;
    padding: 12px;
    z-index: 900;
    transition: transform 0.2s ease, width 0.2s ease;
}

.yt-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 890;
}

.yt-main {
    margin-left: var(--sidebar-width);
    padding: 0 24px 48px;
    transition: margin-left 0.2s ease;
}

/* Collapsed mini-sidebar on desktop */
body.sidebar-collapsed .yt-sidebar {
    width: var(--sidebar-mini);
    padding: 8px 4px;
}

body.sidebar-collapsed .yt-sidebar .sidebar-label,
body.sidebar-collapsed .yt-sidebar .sidebar-section-title,
body.sidebar-collapsed .yt-sidebar .sidebar-subs-section,
body.sidebar-collapsed .yt-sidebar .sidebar-footer,
body.sidebar-collapsed .yt-sidebar .sidebar-divider {
    display: none;
}

body.sidebar-collapsed .yt-sidebar .sidebar-link {
    flex-direction: column;
    gap: 6px;
    padding: 14px 4px;
    font-size: 10px;
    justify-content: center;
    text-align: center;
}

body.sidebar-collapsed .yt-sidebar .sidebar-link .sidebar-label-mini {
    display: block;
    font-size: 10px;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.sidebar-collapsed .yt-main {
    margin-left: var(--sidebar-mini);
}

/* Drawer mode (used on watch page & smaller viewports) */
body.sidebar-drawer .yt-main {
    margin-left: 0;
}

body.sidebar-drawer .yt-sidebar {
    transform: translateX(-100%);
    box-shadow: 6px 0 24px rgba(0,0,0,0.6);
}

body.sidebar-drawer.drawer-open .yt-sidebar {
    transform: translateX(0);
}

body.sidebar-drawer.drawer-open .yt-sidebar-backdrop {
    display: block;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 12px;
    height: 40px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--yt-text);
    transition: background-color 0.12s;
}

.sidebar-link:hover {
    background: var(--yt-chip);
}

.sidebar-link.active {
    background: var(--yt-chip);
    font-weight: 600;
}

.sidebar-link.active svg,
.sidebar-link.active i {
    color: var(--accent);
}

.sidebar-link i {
    font-size: 16px;
}

.sidebar-label-mini {
    display: none;
}

.sidebar-divider {
    height: 1px;
    background: #2a2a2a;
    margin: 12px 0;
}

.sidebar-section-title {
    padding: 6px 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--yt-text);
}

.sidebar-footer {
    padding: 12px;
    font-size: 12px;
    color: #777;
    line-height: 1.6;
}

/* Category Chips */
.chips-bar {
    position: sticky;
    top: var(--header-height);
    background: rgba(15, 15, 15, 0.96);
    backdrop-filter: blur(8px);
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    z-index: 100;
    scrollbar-width: none;
}

.chips-bar::-webkit-scrollbar { display: none; }

.chip {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--yt-chip);
    color: var(--yt-text);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s, color 0.15s;
}

.chip:hover {
    background: var(--yt-chip-hover);
}

.chip.active {
    background: #f1f1f1;
    color: #0f0f0f;
}

.chip.accent-active {
    background: var(--accent);
    color: #fff;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
    gap: 32px 16px;
    margin-top: 12px;
}

.video-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #1c1c1c;
    display: block;
}

.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.video-card:hover .thumb-wrap img {
    transform: scale(1.025);
}

.thumb-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.84);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.2px;
}

.thumb-featured {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(var(--accent-rgb), 0.92);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.video-meta-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.video-card-info {
    flex: 1;
    min-width: 0;
}

.video-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--yt-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.video-card-channel {
    font-size: 14px;
    color: var(--yt-muted);
    display: inline-flex;
    align-items: center;
    margin-bottom: 2px;
}

.video-card-channel:hover {
    color: var(--yt-text);
}

.video-card-stats {
    font-size: 13px;
    color: var(--yt-muted);
}

/* Watch Page (Screenshot Layout) */
.watch-shell {
    max-width: 1750px;
    margin: 0 auto;
    padding: 18px 24px 48px;
}

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 402px;
    gap: 24px;
    align-items: start;
}

.watch-primary {
    min-width: 0;
}

.watch-secondary {
    min-width: 0;
}

/* Theater Mode */
body.theater-mode .watch-theater-slot {
    width: 100%;
    background: #000;
    margin-bottom: 20px;
}

body.theater-mode .watch-theater-slot .yt-player-wrap {
    max-height: 80vh;
    border-radius: 0;
    margin: 0 auto;
    max-width: 1480px;
}

/* Custom Video Player */
.yt-player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    user-select: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 0 60px rgba(var(--accent-rgb), 0.08);
}

.yt-player-wrap:fullscreen {
    border-radius: 0;
}

.yt-player-wrap.pseudo-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 99999 !important;
    aspect-ratio: auto !important;
}

body.player-pseudo-fs-lock {
    overflow: hidden !important;
}

.player-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(4px);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.player-big-play:hover {
    background: rgba(var(--accent-rgb), 0.9);
    transform: translate(-50%, -50%) scale(1.06);
}

.yt-player-wrap.paused .player-big-play,
.yt-player-wrap.is-touch.controls-active .player-big-play {
    display: flex;
}

.yt-player-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
    cursor: pointer;
}

.player-center-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}

.player-center-feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
}

.player-seek-flash {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 18px;
    border-radius: 30px;
    background: rgba(0,0,0,0.68);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.player-seek-flash.left { left: 10%; }
.player-seek-flash.right { right: 10%; }
.player-seek-flash.show { opacity: 1; }

.player-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 12px 6px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 10;
}

.yt-player-wrap.paused .player-controls,
.yt-player-wrap.controls-active .player-controls {
    opacity: 1;
    pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
    .yt-player-wrap:hover .player-controls {
        opacity: 1;
        pointer-events: auto;
    }
}

.yt-player-wrap.is-touch .player-progress-area {
    height: 24px;
}

.yt-player-wrap.is-touch .player-progress-thumb {
    transform: translateY(-50%) scale(1);
}

/* Progress Bar */
.player-progress-area {
    position: relative;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 2px;
}

.player-progress-track {
    position: relative;
    width: 100%;
    height: 3.5px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    transition: height 0.12s ease;
}

.player-progress-area:hover .player-progress-track {
    height: 5.5px;
}

.player-progress-buffered {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.38);
    border-radius: 2px;
    width: 0%;
}

.player-progress-hover {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.52);
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
}

.player-progress-played {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
}

.player-progress-thumb {
    position: absolute;
    right: -6px;
    top: 50%;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(-50%) scale(0);
    transition: transform 0.12s ease;
    box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.8);
}

.player-progress-area:hover .player-progress-thumb,
.player-progress-area.dragging .player-progress-thumb {
    transform: translateY(-50%) scale(1);
}

.player-time-tooltip {
    position: absolute;
    bottom: 22px;
    transform: translateX(-50%);
    background: rgba(15, 15, 15, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    pointer-events: none;
    display: none;
    white-space: nowrap;
}

.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
}

.player-controls-left, .player-controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.p-btn {
    background: transparent;
    border: none;
    color: #fff;
    width: 38px;
    height: 36px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.92;
    transition: opacity 0.15s, background 0.15s;
}

.p-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

.player-volume-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
}

.player-volume-slider {
    width: 0;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
    accent-color: var(--accent);
    cursor: pointer;
}

.player-volume-wrap:hover .player-volume-slider,
.player-volume-slider:focus {
    width: 68px;
    opacity: 1;
    margin-right: 6px;
}

.player-time-display {
    font-size: 13px;
    color: #f1f1f1;
    margin-left: 6px;
    font-variant-numeric: tabular-nums;
}

.player-speed-wrap {
    position: relative;
}

.player-speed-menu {
    position: absolute;
    bottom: 44px;
    right: 0;
    background: rgba(24, 24, 24, 0.96);
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    padding: 6px 0;
    min-width: 120px;
    display: none;
    z-index: 20;
}

.player-speed-menu.open {
    display: block;
}

.player-speed-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 7px 14px;
    background: none;
    border: none;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.player-speed-opt:hover { background: rgba(255,255,255,0.1); }
.player-speed-opt.active { color: var(--accent); font-weight: 700; }

/* Autoplay Switch */
.autoplay-switch {
    width: 34px;
    height: 14px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    margin: 0 6px;
    transition: background 0.2s;
}

.autoplay-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ddd;
    top: -2px;
    left: 0;
    transition: transform 0.2s, background 0.2s;
}

.autoplay-switch.on {
    background: rgba(var(--accent-rgb), 0.55);
}

.autoplay-switch.on::after {
    transform: translateX(16px);
    background: var(--accent);
}

/* Watch Metadata & Actions */
.watch-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    margin: 14px 0 12px;
    color: var(--yt-text);
}

.watch-owner-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

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

.watch-channel-meta {
    display: flex;
    flex-direction: column;
    margin-right: 10px;
}

.watch-channel-name {
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.watch-sub-count {
    font-size: 12px;
    color: var(--yt-muted);
}

.pill-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    border: none;
    background: var(--yt-chip);
    color: var(--yt-text);
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.pill-btn:hover {
    background: var(--yt-chip-hover);
}

.pill-btn.subscribe-btn {
    background: #f1f1f1;
    color: #0f0f0f;
    font-weight: 600;
}

.pill-btn.subscribe-btn:hover {
    background: #d9d9d9;
}

.pill-btn.subscribe-btn.subscribed {
    background: var(--yt-chip);
    color: var(--yt-text);
}

.pill-btn.accent-btn {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.pill-btn.accent-btn:hover {
    background: var(--accent-hover);
}

.watch-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.like-dislike-group {
    display: inline-flex;
    align-items: center;
    height: 36px;
    background: var(--yt-chip);
    border-radius: 18px;
    overflow: hidden;
}

.like-dislike-group button {
    height: 36px;
    padding: 0 14px;
    background: transparent;
    border: none;
    color: var(--yt-text);
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.like-dislike-group button:hover {
    background: var(--yt-chip-hover);
}

.like-dislike-group button.active {
    color: var(--accent);
}

.like-dislike-sep {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.16);
}

.pill-btn.active {
    color: var(--accent);
}

/* Description Box */
.watch-description-box {
    margin-top: 14px;
    background: var(--yt-chip);
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.watch-description-box:hover {
    background: #303030;
}

.watch-desc-stats {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.watch-desc-body {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
    max-height: 44px;
    overflow: hidden;
}

.watch-description-box.expanded .watch-desc-body {
    max-height: none;
}

.watch-desc-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-link {
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
}

.watch-desc-toggle {
    margin-top: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--yt-text);
}

/* Comments */
.comments-section {
    margin-top: 24px;
}

.comments-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.comments-count {
    font-size: 20px;
    font-weight: 700;
}

.comment-form-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.comment-input-box {
    flex: 1;
}

.comment-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    padding: 6px 0;
    color: var(--yt-text);
    font-size: 14px;
    outline: none;
    resize: none;
    transition: border-color 0.2s;
}

.comment-input:focus {
    border-bottom: 2px solid var(--accent);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.comment-item {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
}

.comment-body-wrap {
    flex: 1;
    min-width: 0;
}

.comment-author-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    color: var(--yt-text);
}

.comment-time {
    color: var(--yt-muted);
    font-size: 12px;
}

.comment-pinned-badge {
    font-size: 11px;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.14);
    padding: 2px 7px;
    border-radius: 6px;
    margin-bottom: 4px;
    display: inline-block;
}

.comment-text {
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-line;
    margin-bottom: 6px;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--yt-muted);
}

.comment-act-btn {
    background: none;
    border: none;
    color: var(--yt-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 14px;
    font-size: 12px;
}

.comment-act-btn:hover {
    background: var(--yt-chip);
    color: var(--yt-text);
}

.comment-act-btn.active {
    color: var(--accent);
}

.comment-replies {
    margin-top: 12px;
    padding-left: 14px;
    border-left: 2px solid #2a2a2a;
}

/* Suggested Right Column */
.suggested-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.suggested-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.suggested-thumb {
    position: relative;
    width: 168px;
    height: 94px;
    border-radius: 8px;
    overflow: hidden;
    background: #1c1c1c;
    flex-shrink: 0;
}

.suggested-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggested-info {
    flex: 1;
    min-width: 0;
}

.suggested-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.suggested-channel, .suggested-stats {
    font-size: 12px;
    color: var(--yt-muted);
}

/* Channel Page */
.channel-banner {
    width: 100%;
    height: 200px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(120deg, #1e1e1e, rgba(var(--accent-rgb), 0.32), #151515);
    margin-top: 16px;
}

.channel-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0 16px;
    border-bottom: 1px solid #2a2a2a;
}

.channel-header-left {
    display: flex;
    align-items: center;
    gap: 22px;
}

.channel-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.channel-meta-line {
    color: var(--yt-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.channel-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 20px;
}

.channel-tab {
    padding: 12px 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--yt-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.channel-tab.active {
    color: var(--yt-text);
    border-bottom-color: var(--accent);
}

/* Forms, Cards, Tables (Upload, Studio, Admin, Auth) */
.page-container {
    max-width: 1220px;
    margin: 24px auto;
}

.card-box {
    background: var(--yt-bg-elevated);
    border: 1px solid #2b2b2b;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background: #121212;
    border: 1px solid #353535;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--yt-text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.form-control:focus {
    border-color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--yt-bg-elevated);
    border: 1px solid #2b2b2b;
    border-radius: 12px;
    padding: 16px 18px;
}

.stat-label {
    font-size: 12px;
    color: var(--yt-muted);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--yt-text);
}

.stat-value.accent {
    color: var(--accent);
}

.data-table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #282828;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--yt-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #2b2b2b;
    color: #ddd;
}

.badge-orange { background: rgba(var(--accent-rgb), 0.18); color: var(--accent); }
.badge-green  { background: rgba(46, 204, 113, 0.18); color: #4ade80; }
.badge-red    { background: rgba(239, 68, 68, 0.18); color: #f87171; }
.badge-blue   { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.35); color: #86efac; }
.alert-error   { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.35); color: #fca5a5; }
.alert-info    { background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.35); color: #fdba74; }

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed #444;
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    background: #141414;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
}

.upload-progress-bar {
    height: 10px;
    border-radius: 6px;
    background: #2b2b2b;
    overflow: hidden;
    margin-top: 10px;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #ff9e44);
    transition: width 0.15s;
}

/* Auth Box */
.auth-wrap {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #181818;
    border: 1px solid #2e2e2e;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Modal & Toast */
.yt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.yt-modal-backdrop.open {
    display: flex;
}

.yt-modal {
    width: 100%;
    max-width: 480px;
    background: #212121;
    border: 1px solid #353535;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 18px 48px rgba(0,0,0,0.7);
}

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3000;
}

.toast {
    background: #282828;
    color: #fff;
    border-left: 4px solid var(--accent);
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Search Result Card */
.search-result-card {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
}

.search-result-thumb {
    width: 360px;
    max-width: 42%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 1120px) {
    .watch-layout {
        grid-template-columns: 1fr;
    }
    .yt-main {
        margin-left: var(--sidebar-mini);
    }
    .yt-sidebar {
        width: var(--sidebar-mini);
        padding: 8px 4px;
    }
    .yt-sidebar .sidebar-label,
    .yt-sidebar .sidebar-section-title,
    .yt-sidebar .sidebar-subs-section,
    .yt-sidebar .sidebar-footer,
    .yt-sidebar .sidebar-divider {
        display: none;
    }
    .yt-sidebar .sidebar-link {
        flex-direction: column;
        gap: 6px;
        padding: 14px 4px;
        font-size: 10px;
        justify-content: center;
    }
    .yt-sidebar .sidebar-link .sidebar-label-mini {
        display: block;
    }
}

@media (max-width: 768px) {
    .yt-header { padding: 0 8px; gap: 6px; }
    .yt-header-left { min-width: auto; gap: 6px; }
    .yt-header-right { min-width: auto; gap: 4px; }
    .yt-logo { font-size: 17px; }
    .create-text { display: none; }
    .create-pill-btn { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; }
    .signin-pill-btn { padding: 0 10px; font-size: 12px; height: 32px; gap: 5px; }
    .yt-mic-btn { display: none; }
    .yt-main { margin-left: 0 !important; padding: 0 12px 36px; }
    .yt-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
        padding: 12px !important;
    }
    body.drawer-open .yt-sidebar {
        transform: translateX(0);
    }
    body.drawer-open .yt-sidebar .sidebar-label,
    body.drawer-open .yt-sidebar .sidebar-section-title,
    body.drawer-open .yt-sidebar .sidebar-subs-section,
    body.drawer-open .yt-sidebar .sidebar-footer,
    body.drawer-open .yt-sidebar .sidebar-divider {
        display: block;
    }
    body.drawer-open .yt-sidebar .sidebar-link {
        flex-direction: row;
        gap: 20px;
        padding: 0 12px;
        font-size: 14px;
        justify-content: flex-start;
    }
    body.drawer-open .yt-sidebar .sidebar-label-mini { display: none; }
    body.drawer-open .yt-sidebar-backdrop { display: block; }
    .dropdown-panel.notif-panel {
        position: fixed;
        top: 56px;
        left: 8px;
        right: 8px;
        width: auto;
        max-height: 70vh;
    }
    .dropdown-panel {
        max-width: calc(100vw - 16px);
    }
    .watch-shell { padding: 0 12px 36px; }
    .watch-primary .yt-player-wrap {
        margin: 0 -12px;
        width: calc(100% + 24px);
        border-radius: 0;
    }
    .watch-title { font-size: 17px; margin: 12px 0 10px; }
    .watch-owner-bar { flex-direction: column; align-items: stretch; gap: 12px; }
    .watch-channel-left { justify-content: space-between; width: 100%; }
    .watch-channel-meta { flex: 1; min-width: 0; }
    .watch-actions-right {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .watch-actions-right::-webkit-scrollbar { display: none; }
    .watch-actions-right > * { flex-shrink: 0; }
    .channel-banner { height: 120px; border-radius: 10px; }
    .channel-header { gap: 14px; }
    .channel-header-left { gap: 14px; }
    .avatar-2xl { width: 68px; height: 68px; font-size: 24px; }
    .channel-title { font-size: 20px; }
    .channel-tabs { overflow-x: auto; gap: 18px; }
    .card-box { padding: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .search-result-card { flex-direction: column; }
    .search-result-thumb { width: 100%; max-width: 100%; }
}

@media (max-width: 640px) {
    .mobile-only-btn { display: inline-flex; }
    .yt-header-center { display: none; }
    .yt-header.mobile-search-active .yt-header-left,
    .yt-header.mobile-search-active .yt-header-right {
        display: none;
    }
    .yt-header.mobile-search-active .yt-header-center {
        display: flex;
        flex: 1;
        max-width: 100%;
        gap: 6px;
    }
    .yt-header.mobile-search-active .yt-search-btn {
        width: 46px;
    }
    .video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .p-hide-mobile {
        display: none !important;
    }
    .player-volume-slider {
        display: none !important;
    }
    .player-controls {
        padding: 20px 8px 4px;
    }
    .p-btn {
        width: 34px;
        height: 34px;
    }
    .player-time-display {
        font-size: 12px;
        margin-left: 2px;
    }
    .player-big-play {
        width: 54px;
        height: 54px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .suggested-card {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 8px;
    }
    .suggested-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .suggested-title {
        font-size: 15px;
    }
}
