/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #0f0f0f;
    color: #f1f1f1;
    min-height: 100vh;
}

/* Top Navigation Bar */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 56px;
    background-color: #0f0f0f;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #2a2a2a;
}

/* Left Section */
.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 8px;
}

.hamburger {
    width: 24px;
    height: 2px;
    background-color: #f1f1f1;
    border-radius: 2px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.logo-icon {
    width: 32px;
    height: 24px;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Center Section */
.nav-center {
    flex: 1;
    max-width: 640px;
    display: flex;
    justify-content: center;
}

.search-container {
    display: flex;
    width: 100%;
    max-width: 580px;
}

.search-input {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    background-color: #121212;
    border: 1px solid #303030;
    border-radius: 40px 0 0 40px;
    color: #f1f1f1;
    font-size: 16px;
}

.search-input:focus {
    outline: none;
    border-color: #3ea6ff;
}

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

.search-btn {
    width: 64px;
    height: 40px;
    background-color: #222;
    border: 1px solid #303030;
    border-left: none;
    border-radius: 0 40px 40px 0;
    cursor: pointer;
    font-size: 16px;
}

.search-btn:hover {
    background-color: #333;
}

/* Right Section */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: #272727;
}

.btn-icon {
    font-size: 20px;
}

/* --- CREATE BUTTON STYLES (UPDATED) --- */
.create-btn {
    width: auto;
    padding: 0 12px;
    border-radius: 20px;
    gap: 8px;
    /* Always show a subtle "active" background to indicate it's interactive */
    background-color: #272727; 
    transition: all 0.2s ease;
}

/* Force Create Button Text and Icon to White */
.create-btn .btn-text,
.create-btn .btn-icon {
    color: #ffffff !important;
}

/* Special Hover Effect: Brighter background + slight scale up */
.create-btn:hover {
    background-color: #3a3a3a;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Active click effect */
.create-btn:active {
    transform: scale(0.98);
}

/* --------------------------------------- */

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background-color: #cc0000;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0f0f0f;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3ea6ff, #0066cc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* Dropdown Styles */
.dropdown {
    position: absolute;
    top: 56px;
    right: 0;
    background-color: #272727;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    display: none;
    z-index: 1001;
}

.dropdown.active {
    display: block;
}

/* ADD SPACING TO RIGHT-SIDE DROPDOWNS */
.create-dropdown {
    right: 8px;
    min-width: 240px;
}

.notification-dropdown {
    right: 8px;
    min-width: 360px;
}

/* PROFILE DROPDOWN - NO SCROLLING, ALL ITEMS VISIBLE */
.profile-dropdown {
    right: 8px;
    min-width: 320px;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 8px 0;
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #3a3a3a;
}

.header-text {
    font-size: 16px;
    font-weight: 500;
}

.settings-link {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 50%;
}

.settings-link:hover {
    background-color: #3a3a3a;
}

.dropdown-divider {
    height: 1px;
    background-color: #3a3a3a;
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #3a3a3a;
}

.item-icon {
    font-size: 18px;
    width: 24px;
}

.item-text {
    font-size: 14px;
}

/* Notification Items */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.notification-item:hover {
    background-color: #3a3a3a;
}

.channel-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-time {
    font-size: 12px;
    color: #aaa;
}

.notification-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: 8px;
    background: linear-gradient(135deg, #333, #444);
    flex-shrink: 0;
    position: relative;
}

.notification-menu {
    position: absolute;
    top: 8px;
    right: 8px;
}

.menu-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    color: #aaa;
}

.menu-trigger:hover {
    background-color: #3a3a3a;
}

.menu-options {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #272727;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    display: none;
    z-index: 1002;
}

.menu-options.active {
    display: block;
}

.menu-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
}

.menu-option:hover {
    background-color: #3a3a3a;
}

/* Sidebar Styles */
.sidebar {
    width: 240px;
    background-color: #0f0f0f;
    padding: 12px 0;
    transition: transform 0.3s ease;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 999;
}

.sidebar.collapsed {
    transform: translateX(-240px);
}

.sidebar-content {
    padding: 0 12px;
}

.sidebar-section {
    margin-bottom: 12px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-header:hover {
    background-color: #272727;
    border-radius: 8px;
}

.section-title {
    font-weight: 500;
}

.expand-icon {
    font-size: 12px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 12px;
    color: #f1f1f1;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s;
    font-size: 14px;
}

.sidebar-item:hover {
    background-color: #272727;
}

.sidebar-item.active {
    background-color: #272727;
    font-weight: 500;
}

.sidebar-item .item-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-item .channel-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

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

/* UPDATED: Default to BLOCK so menus are open by default */
.sidebar-submenu {
    display: block; 
    margin-top: 4px;
}

/* Class to hide if toggled closed */
.sidebar-submenu.hidden {
    display: none;
}

/* Main Content */
.main-content {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
}

.content-area {
    flex: 1;
    padding: 24px;
    background-color: #0f0f0f;
    margin-left: 240px;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .content-area {
    margin-left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-center {
        display: none;
    }
    
    .create-btn .btn-text {
        display: none;
    }
    
    .create-btn {
        width: 40px;
        height: 40px;
        padding: 0;
    }
    
    .sidebar {
        transform: translateX(-240px);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content-area {
        margin-left: 0;
    }
}

/* ========== Shorts content area (immersive feed) ========== */
body.shorts-page {
    overflow: hidden;
}
.content-area.shorts-content-area {
    min-width: 0;
    padding: 0;
    margin-left: 240px;
    height: calc(100vh - 56px);
    overflow: hidden;
    background: #0a0a0a;
    position: relative;
}
.sidebar.collapsed + .content-area.shorts-content-area {
    margin-left: 0;
}
@media (max-width: 768px) {
    .content-area.shorts-content-area { margin-left: 0; }
}

.shorts-layout {
    --shorts-frame-h: min(92vh, calc(100vh - 56px - 24px), 940px);
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 8px 12px 12px;
}
.shorts-ambient {
    position: absolute;
    inset: 0;
    background: #0d0d0d center / cover no-repeat;
    filter: blur(56px) saturate(1.25) brightness(0.85);
    transform: scale(1.18);
    opacity: 0.62;
    transition: background-image 0.45s ease, background-color 0.45s ease, opacity 0.3s ease;
    pointer-events: none;
}
.shorts-ambient::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 50% 45%, transparent 20%, rgba(0, 0, 0, 0.55) 100%),
        rgba(0, 0, 0, 0.35);
}
.shorts-stage {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: 100%;
    height: 100%;
    max-width: 760px;
    padding: 0;
}
.shorts-player-shell {
    position: relative;
    height: var(--shorts-frame-h);
    width: min(460px, calc(var(--shorts-frame-h) * 9 / 16), 100%);
    max-height: var(--shorts-frame-h);
    flex: 0 0 auto;
}
.shorts-feed {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 12px 28px rgba(0, 0, 0, 0.35),
        0 28px 64px rgba(0, 0, 0, 0.55);
    outline: none;
    isolation: isolate;
}
.shorts-feed::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    pointer-events: none;
    z-index: 8;
}
.shorts-feed:focus-visible {
    box-shadow:
        0 0 0 2px #3ea6ff,
        0 12px 28px rgba(0, 0, 0, 0.35),
        0 28px 64px rgba(0, 0, 0, 0.55);
}
.shorts-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}
.shorts-slide.is-prev { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.shorts-slide.is-next { transform: translateY(100%); opacity: 0; pointer-events: none; }
.shorts-slide.is-active { transform: translateY(0); opacity: 1; z-index: 2; }
.shorts-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    cursor: pointer;
}
.shorts-slide-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.shorts-slide.show-controls .shorts-slide-controls,
.shorts-slide:hover .shorts-slide-controls { opacity: 1; }
.shorts-ctrl-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
}
.shorts-ctrl-btn:hover {
    background: rgba(30, 30, 30, 0.75);
    transform: scale(1.05);
}
.shorts-progress {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}
.shorts-slide.show-controls .shorts-progress,
.shorts-slide:hover .shorts-progress { height: 4px; }
.shorts-progress > span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #fff 0%, #e8e8e8 100%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}
.shorts-unmute-hint {
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    z-index: 6;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-weight: 700;
    pointer-events: none;
}
.shorts-unmute-hint.show { display: grid; }
.shorts-unmute-hint::after {
    content: 'Tap to unmute';
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(8px);
    font-size: 13px;
    letter-spacing: 0.01em;
}
.shorts-unmute-hint { font-size: 0; color: transparent; }
.shorts-buffer {
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    z-index: 5;
    background: rgba(0, 0, 0, 0.18);
}
.shorts-buffer.show { display: grid; }
.shorts-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: shorts-spin 0.7s linear infinite;
}
@keyframes shorts-spin { to { transform: rotate(360deg); } }
.shorts-loading-card,
.shorts-empty-card,
.shorts-error-card {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 12px;
    text-align: center;
    color: #ddd;
    padding: 24px;
    z-index: 3;
}
.shorts-loading-card[hidden],
.shorts-empty-card[hidden],
.shorts-error-card[hidden] {
    display: none !important;
}
.shorts-empty-card button,
.shorts-error-card button {
    margin: 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: #fff;
    color: #111;
    font-weight: 700;
    cursor: pointer;
}

.shorts-side-rail {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    flex: 0 0 auto;
    z-index: 3;
    padding: 8px 0;
}
.shorts-action {
    width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    padding: 0;
}
.shorts-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.shorts-action:hover .shorts-action-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.06);
}
.shorts-action.active .shorts-action-icon {
    background: rgba(62, 166, 255, 0.28);
    color: #3ea6ff;
}
.shorts-action.active[data-action="like"] .shorts-action-icon {
    color: #3ea6ff;
    animation: shorts-like-bounce 0.35s ease;
}
@keyframes shorts-like-bounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
.shorts-action-count {
    font-size: 12px;
    font-weight: 600;
    color: #eee;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.shorts-meta-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    padding: 56px 16px 20px;
    border-radius: 0 0 18px 18px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.55) 42%, rgba(0, 0, 0, 0.82) 100%);
    color: #fff;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}
.shorts-meta-panel.collapsed .shorts-title,
.shorts-meta-panel.collapsed .shorts-music,
.shorts-meta-panel.collapsed .shorts-hashtags,
.shorts-meta-panel.collapsed .shorts-desc,
.shorts-meta-panel.collapsed .shorts-meta-stats { display: none; }
.shorts-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.shorts-channel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    min-width: 0;
}
.shorts-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333 center / cover no-repeat;
    display: grid;
    place-items: center;
    font-weight: 700;
    flex: 0 0 auto;
    overflow: hidden;
}
.shorts-channel-name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shorts-subscribe {
    margin-left: auto;
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    background: #cc0000;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    flex: 0 0 auto;
}
.shorts-subscribe[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.18);
    color: #eee;
}
.shorts-title {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shorts-music {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    opacity: 0.92;
}
.shorts-music-marquee {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
}
.shorts-music-marquee span {
    display: inline-block;
    padding-left: 100%;
    animation: shorts-marquee 10s linear infinite;
}
@keyframes shorts-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
.shorts-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.shorts-hashtags a {
    color: #9fceff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}
.shorts-desc-body {
    font-size: 13px;
    line-height: 1.45;
    max-height: 2.9em;
    overflow: hidden;
}
.shorts-desc.expanded .shorts-desc-body { max-height: none; }
.shorts-desc-more {
    border: 0;
    background: transparent;
    color: #ddd;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0 0;
}
.shorts-meta-stats {
    margin: 8px 0 0;
    font-size: 12px;
    color: #cfcfcf;
}

.shorts-like-burst {
    position: fixed;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%) scale(0.4);
    font-size: 72px;
    opacity: 0;
    pointer-events: none;
    z-index: 80;
}
.shorts-like-burst.show {
    animation: shorts-burst 0.7s ease forwards;
}
@keyframes shorts-burst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}
.shorts-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(28, 28, 28, 0.96);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    z-index: 90;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.shorts-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.shorts-drawer,
.shorts-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
}
.shorts-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}
.shorts-drawer-panel,
.shorts-modal-panel {
    position: absolute;
    background: #1a1a1a;
    color: #eee;
    display: flex;
    flex-direction: column;
}
.shorts-comments-panel {
    right: 0;
    top: 56px;
    bottom: 0;
    width: min(420px, 100%);
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.4);
}
.shorts-drawer-handle {
    display: none;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #555;
    margin: 10px auto 0;
}
.shorts-drawer-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #2a2a2a;
}
.shorts-drawer-head strong { flex: 1; }
.shorts-drawer-head select {
    background: #111;
    color: #eee;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 4px 8px;
}
.shorts-drawer-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    width: 36px;
    height: 36px;
}
.shorts-comment-list {
    flex: 1;
    overflow: auto;
    padding: 12px 16px;
}
.shorts-comment-item {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.shorts-comment-item .av {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #333;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
}
.shorts-comment-item .meta { font-size: 12px; color: #aaa; margin-bottom: 4px; }
.shorts-comment-item .body { font-size: 14px; line-height: 1.4; }
.shorts-comment-item .creator-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #3ea6ff;
    color: #111;
    font-size: 10px;
    font-weight: 800;
}
.shorts-comment-form {
    border-top: 1px solid #2a2a2a;
    padding: 12px 16px 16px;
    display: grid;
    gap: 8px;
}
.shorts-comment-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 56px;
    border-radius: 10px;
    border: 1px solid #333;
    background: #111;
    color: #fff;
    padding: 10px;
    font: inherit;
}
.shorts-comment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.shorts-comment-form-actions button {
    border: 0;
    border-radius: 999px;
    padding: 8px 16px;
    background: #3ea6ff;
    color: #111;
    font-weight: 700;
    cursor: pointer;
}
.shorts-comment-form-actions button:disabled {
    opacity: 0.5;
    cursor: default;
}

.shorts-modal-panel {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(440px, calc(100% - 32px));
    max-height: min(80vh, 560px);
    border-radius: 14px;
    overflow: auto;
}
.shorts-share-grid,
.shorts-remix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px 16px;
}
.shorts-share-grid button,
.shorts-remix-grid button {
    border: 1px solid #333;
    background: #222;
    color: #eee;
    border-radius: 10px;
    padding: 12px 10px;
    cursor: pointer;
    font-weight: 600;
    text-align: left;
}
.shorts-remix-grid button {
    display: flex;
    align-items: center;
    gap: 8px;
}
.shorts-remix-note {
    margin: 0;
    padding: 0 16px;
    color: #aaa;
    font-size: 12px;
}
.shorts-share-start {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 16px;
    font-size: 13px;
    color: #ccc;
}

.shorts-context-menu {
    position: fixed;
    z-index: 110;
    min-width: 200px;
    padding: 6px;
    border-radius: 10px;
    background: #1f1f1f;
    border: 1px solid #333;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    display: grid;
}
.shorts-context-menu button {
    border: 0;
    background: transparent;
    color: #eee;
    text-align: left;
    padding: 10px 12px;
    border-radius: 7px;
    cursor: pointer;
}
.shorts-context-menu button:hover { background: rgba(255, 255, 255, 0.08); }

@media (max-width: 900px) {
    .shorts-layout {
        --shorts-frame-h: calc(100vh - 56px);
        padding: 0;
    }
    .shorts-player-shell {
        width: 100%;
        height: 100%;
        max-height: none;
    }
    .shorts-meta-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-width: none;
        padding: 48px 72px 22px 14px;
        background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78));
        border-radius: 0;
    }
    .shorts-side-rail {
        position: absolute;
        right: 10px;
        bottom: 110px;
        z-index: 7;
    }
    .shorts-feed {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        aspect-ratio: auto;
        border-radius: 0;
        box-shadow: none;
    }
    .shorts-feed::before { display: none; }
    .shorts-progress {
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        height: 2px;
    }
    .shorts-stage {
        max-width: none;
        padding: 0;
    }
    .shorts-comments-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: min(72vh, 640px);
        border-radius: 16px 16px 0 0;
    }
    .shorts-drawer-handle { display: block; }
    .shorts-modal-panel {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        transform: none;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 78vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shorts-slide { transition: none; }
    .shorts-like-burst.show { animation: none; opacity: 1; }
    .shorts-music-marquee span { animation: none; padding-left: 0; }
    .shorts-ambient { filter: none; opacity: 0.35; }
}

.shorts-slide-title {
    position: absolute;
    left: 12px;
    right: 72px;
    bottom: 18px;
    z-index: 3;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.shorts-slide.show-controls .shorts-slide-title { opacity: 1; }
.shorts-verified {
    display: inline-grid;
    place-items: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    border-radius: 50%;
    background: #3ea6ff;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    vertical-align: middle;
}
.shorts-comment-empty { color: #888; padding: 24px 8px; text-align: center; }
.shorts-desc-body .desc-link,
.shorts-desc-body .timestamp,
.shorts-desc-body .desc-channel {
    color: #9fceff;
    text-decoration: none;
    font-weight: 600;
}
.shorts-desc-body .desc-favicon {
    width: 12px;
    height: 12px;
    vertical-align: middle;
    margin-right: 3px;
}

/* Entered via /m/shorts/: leave room for the injected shared mobile bottom nav. */
body.m-mobile-shell .shorts-layout { padding-bottom: 58px; }
body.m-mobile-shell #mBottomNav { z-index: 300; }
