* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #222;
    background: #fff;
}

a {
    color: #167ac6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.yt-header {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #d8d8d8;
    position: sticky;
    top: 0;
    z-index: 50;
}

.yt-header-inner {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 22px;
}

.yt-logo img {
    width: 118px;
    height: auto;
    display: block;
}

.yt-search {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 640px;
}

.yt-search input {
    height: 30px;
    border: 1px solid #bbb;
    border-right: 0;
    padding: 5px 8px;
    font-size: 14px;
    flex: 1;
}

.yt-search button {
    height: 30px;
    width: 70px;
    border: 1px solid #aaa;
    background: #f4f4f4;
    cursor: pointer;
}

.yt-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.yt-upload {
    background: #f8f8f8;
    border: 1px solid #c6c6c6;
    color: #333;
    padding: 7px 12px;
    border-radius: 2px;
    font-weight: bold;
}

.yt-signin {
    background: #167ac6;
    color: #fff !important;
    padding: 7px 13px;
    border-radius: 2px;
    font-weight: bold;
}

.yt-user {
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.yt-user img {
    width: 26px;
    height: 26px;
    object-fit: cover;
}

.page {
    display: flex;
    min-height: calc(100vh - 56px);
}

.guide {
    width: 160px;
    background: #fff;
    border-right: 1px solid #eee;
    padding: 18px 10px;
}

.guide-title {
    font-size: 11px;
    color: #777;
    margin: 0 0 10px 8px;
}

.guide a {
    display: block;
    color: #333;
    padding: 7px 8px;
    border-radius: 2px;
}

.guide a.active,
.guide a:hover {
    background: #eee;
    text-decoration: none;
}

.home-content {
    flex: 1;
    padding: 22px 28px;
}

.home-content h1 {
    font-size: 20px;
    font-weight: normal;
    margin: 0 0 20px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

.video-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #ddd;
}

.video-card h2 {
    font-size: 14px;
    line-height: 1.25;
    margin: 7px 0 4px;
}

.meta {
    color: #777;
    font-size: 12px;
    line-height: 1.35;
}

.verified {
    display: inline-block;
    color: #fff;
    background: #888;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    font-size: 10px;
    margin-left: 3px;
}

.results-list {
    max-width: 820px;
}

.result-video {
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
}

.result-video img {
    width: 196px;
    height: 110px;
    object-fit: cover;
    background: #ddd;
}

.result-video h2 {
    font-size: 18px;
    font-weight: normal;
    margin: 0 0 5px;
}

.center-card {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 54px;
}

.login-card {
    width: 370px;
    border: 1px solid #ddd;
    background: #fff;
    padding: 28px;
}

.login-card.wide,
.upload-card {
    width: 520px;
}

.login-logo {
    display: block;
    width: 190px;
    margin: 0 auto 24px;
}

.login-card h1 {
    font-size: 22px;
    font-weight: normal;
    margin: 0 0 18px;
}

.login-card label {
    display: block;
    font-weight: bold;
    margin: 13px 0 6px;
}

.login-card input,
.login-card textarea,
.login-card select {
    width: 100%;
    border: 1px solid #bbb;
    padding: 8px;
    font-size: 14px;
}

.login-card button,
.comment-form button,
.admin-row button {
    margin-top: 15px;
    background: #167ac6;
    border: 1px solid #0f68aa;
    color: #fff;
    padding: 8px 14px;
    font-weight: bold;
    cursor: pointer;
}

.error {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    color: #a3261a;
    padding: 8px;
}

.success {
    background: #e9f5e9;
    border: 1px solid #b8ddb8;
    color: #166516;
    padding: 8px;
}

.small-note {
    font-size: 12px;
    color: #777;
}

.check {
    font-weight: normal !important;
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.check input {
    width: auto;
}

.watch-layout {
    display: grid;
    grid-template-columns: minmax(580px, 1fr) 340px;
    gap: 22px;
    padding: 18px 24px;
    width: 100%;
}

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

/* TRUE OLD PLAYER */

.old-player {
    width: 100%;
    background: #000;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.old-player video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    cursor: pointer;
}

.big-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 90px;
    height: 62px;
    margin-left: -45px;
    margin-top: -31px;
    border: 0;
    background: rgba(0, 0, 0, .55);
    color: rgba(255, 255, 255, .95);
    font-size: 41px;
    line-height: 62px;
    text-align: center;
    cursor: pointer;
    z-index: 4;
    border-radius: 4px;
    text-shadow: 0 1px 2px #000;
}

.big-play:hover {
    background: rgba(0, 0, 0, .75);
}

.player-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42px;
    z-index: 5;
    opacity: 1;
    color: #fff;
    background: #070707;
    border-top: 1px solid #1d1d1d;
    font-family: Arial, Helvetica, sans-serif;
    transition: opacity .12s;
}

.old-player.hide-controls .player-controls {
    opacity: 0;
}

.yt-progress {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 11px;
    background: #2f2f2f;
    cursor: pointer;
    border-top: 1px solid #555;
    border-bottom: 1px solid #050505;
}

.yt-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 9px;
    width: 24%;
    background: #777;
}

.yt-progress-played {
    position: absolute;
    left: 0;
    top: 0;
    height: 9px;
    width: 0;
    background: #d00000;
}

.yt-progress-handle {
    position: absolute;
    top: -1px;
    left: 0;
    width: 11px;
    height: 11px;
    margin-left: -5px;
    background: #f4f4f4;
    border: 1px solid #777;
    border-radius: 50%;
    display: none;
}

.yt-progress:hover .yt-progress-handle {
    display: block;
}

.yt-control-row {
    position: absolute;
    left: 0;
    right: 0;
    top: 11px;
    bottom: 0;
    height: 31px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 7px;
    background: #070707;
}

.yt-control-row button {
    height: 27px;
    min-width: 25px;
    padding: 0 6px;
    border: 0;
    background: #070707;
    color: #f2f2f2;
    font-size: 11px;
    line-height: 27px;
    cursor: pointer;
    text-shadow: 0 1px 1px #000;
    font-family: Arial, Helvetica, sans-serif;
}

.yt-control-row button:hover {
    background: #252525;
}

.yt-play {
    width: 28px;
    font-size: 12px !important;
}

.yt-mute {
    width: 25px;
}

.yt-volume {
    width: 48px;
    height: 4px;
    background: #555;
    cursor: pointer;
    position: relative;
    margin-right: 4px;
}

.yt-volume-level {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80%;
    background: #e6e6e6;
}

.yt-time {
    font-size: 11px;
    color: #ddd;
    line-height: 31px;
    min-width: 78px;
    white-space: nowrap;
    text-shadow: 0 1px 1px #000;
}

.yt-control-spacer {
    flex: 1;
}

.yt-hd {
    display: none;
    height: 14px;
    line-height: 14px;
    padding: 0 3px;
    margin-right: 2px;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    background: #cc0000;
    border-radius: 1px;
    text-shadow: 0 1px 1px #000;
}

.yt-hd.active {
    display: inline-block;
}

.yt-settings {
    min-width: 58px !important;
    font-size: 11px !important;
}

.yt-settings.active {
    background: #333 !important;
}

.yt-quality-button {
    min-width: 80px !important;
    font-size: 11px !important;
    font-weight: normal;
    text-align: center;
}

.yt-fullscreen {
    width: 28px;
    font-size: 13px !important;
}

.yt-settings-panel {
    display: none;
    position: absolute;
    right: 38px;
    bottom: 46px;
    width: 180px;
    background: rgba(17, 17, 17, .97);
    color: #fff;
    border: 1px solid #333;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .65);
    z-index: 7;
    padding: 8px;
    font-size: 11px;
}

.yt-settings-panel.open {
    display: block;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 23px;
    gap: 8px;
}

.settings-row span {
    color: #e6e6e6;
}

.settings-row select {
    width: 82px;
    height: 19px;
    font-size: 11px;
    border: 1px solid #555;
    background: #eee;
    color: #111;
    padding: 0;
}

.switch {
    width: 32px;
    height: 17px;
    padding: 0 !important;
    border: 1px solid #555 !important;
    background: #555 !important;
    color: #ddd !important;
    font-size: 10px !important;
    line-height: 15px !important;
}

.switch.is-on {
    background: #f2f2f2 !important;
    color: #111 !important;
}

.video-title {
    font-size: 22px;
    font-weight: normal;
    margin: 14px 0;
}

.video-info-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.channel-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-box img {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.channel-name {
    font-weight: bold;
    color: #333;
}

.subscribe-btn {
    display: inline-block;
    background: #cc181e;
    color: #fff !important;
    border: 0;
    border-radius: 2px;
    padding: 7px 13px;
    font-weight: bold;
    margin-left: 10px;
}

.stats-box {
    text-align: right;
}

.views {
    font-size: 24px;
}

.views-label {
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
}

.like-row {
    display: flex;
    gap: 5px;
}

.like-row button {
    border: 1px solid #ccc;
    background: #f8f8f8;
    color: #333;
    padding: 6px 10px;
    cursor: pointer;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-top: 16px;
}

.tabs button {
    background: #fff;
    border: 0;
    padding: 12px 20px;
    cursor: pointer;
}

.tabs .active {
    border-bottom: 3px solid #cc181e;
}

.share-box {
    border: 1px solid #ddd;
    background: #f8f8f8;
    padding: 12px;
    margin: 12px 0;
}

.share-box input,
.share-box textarea {
    width: 100%;
    border: 1px solid #bbb;
    padding: 7px;
}

.hidden {
    display: none;
}

.description-box {
    padding: 14px 0;
    border-bottom: 1px solid #ddd;
}

.copyright-note {
    background: #fff7d6;
    border: 1px solid #e1c65d;
    padding: 8px;
}

.comments h2 {
    font-size: 18px;
    font-weight: normal;
}

.comment-form textarea {
    width: 100%;
    border: 1px solid #bbb;
    padding: 8px;
}

.comment {
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
    padding: 12px 0;
}

.comment img {
    width: 42px;
    height: 42px;
    object-fit: cover;
}

.related h3 {
    font-size: 14px;
    margin: 0 0 10px;
}

.related-item {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.related-item img {
    width: 128px;
    height: 72px;
    object-fit: cover;
    background: #ddd;
}

.related-item a {
    font-weight: bold;
    color: #333;
}

.channel-page {
    padding: 22px 30px;
    width: 100%;
}

.channel-banner {
    height: 190px;
    background: #222 center / cover;
    border: 1px solid #ddd;
}

.channel-header {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 15px 0;
}

.channel-header img {
    width: 96px;
    height: 96px;
    object-fit: cover;
}

.channel-header h1 {
    margin: 0;
    font-weight: normal;
}

.channel-grid {
    margin-top: 18px;
}

.admin-layout {
    padding: 26px;
    width: 100%;
}

.admin-section {
    border: 1px solid #ddd;
    padding: 16px;
    margin-bottom: 18px;
}

.admin-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 150px 1fr 80px;
    gap: 10px;
    align-items: center;
    border-top: 1px solid #eee;
    padding: 8px;
}

.admin-row.small {
    grid-template-columns: 1fr 120px;
}

.admin-row input,
.admin-row select {
    border: 1px solid #bbb;
    padding: 6px;
}

@media (max-width: 900px) {
    .guide {
        display: none;
    }

    .watch-layout {
        display: block;
    }

    .related {
        margin-top: 25px;
    }

    .yt-header-inner {
        gap: 10px;
    }

    .yt-logo img {
        width: 95px;
    }

    .yt-actions {
        gap: 6px;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}


/* Final old YouTube settings icon fix */
.yt-settings {
    position: relative;
    width: 30px !important;
    min-width: 30px !important;
    font-size: 16px !important;
    padding: 0 !important;
    text-align: center;
    color: #fff !important;
    background: #070707 !important;
}

.yt-settings:hover,
.yt-settings.active {
    background: #252525 !important;
}

.yt-gear {
    display: block;
    line-height: 27px;
    font-size: 16px;
    color: #fff;
}

.yt-hd {
    display: none;
    position: absolute;
    right: -3px;
    top: 2px;
    height: 11px;
    line-height: 11px;
    padding: 0 2px;
    margin: 0;
    font-size: 8px;
    font-weight: bold;
    color: #fff;
    background: #cc0000;
    border: 1px solid #8b0000;
    border-radius: 1px;
    text-shadow: 0 1px 1px #000;
    z-index: 2;
}

.yt-hd.active {
    display: block;
}

.yt-quality-button {
    display: none !important;
}

.yt-quality-current {
    display: none !important;
}

.yt-settings-panel {
    right: 34px;
}


/* Final advanced controls fix */
.old-player video {
    cursor: default !important;
}

.old-player.cursor-hidden,
.old-player.cursor-hidden video,
.old-player.cursor-hidden .player-controls,
.old-player.cursor-hidden .yt-settings-panel {
    cursor: none !important;
}

.yt-settings,
.yt-settings * {
    pointer-events: auto;
}

.yt-mute {
    color: #fff !important;
    filter: brightness(1.4);
}

.yt-volume {
    background: #3b3b3b !important;
    height: 5px !important;
    border: 1px solid #111;
}

.yt-volume-level {
    background: #d00000 !important;
}

.yt-osd {
    position: absolute;
    left: 50%;
    top: 50%;
    min-width: 80px;
    padding: 12px 18px;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 18px;
    text-align: center;
    border-radius: 4px;
    opacity: 0;
    z-index: 10;
    pointer-events: none;
    transition: opacity .15s;
    text-shadow: 0 1px 1px #000;
}

.yt-osd.show {
    opacity: 1;
}

.yt-settings-panel.open {
    display: block !important;
}


/* AJAX state + channel settings */
.like-row button.active {
    background: #e8f0ff !important;
    border-color: #8aa7dc !important;
    color: #111 !important;
}

.channel-settings-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    background: #f8f8f8;
}

.channel-settings-preview img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    background: #ddd;
}


/* Old YouTube layout refinement */
.yt-header {
    height: 62px;
}

.yt-header-inner {
    height: 62px;
    padding-left: 28px;
    align-items: flex-start;
    padding-top: 15px;
}

.yt-logo {
    margin-left: 6px;
    margin-top: 2px;
}

.yt-logo img {
    width: 122px;
}

.yt-search {
    margin-top: 1px;
}

.yt-actions {
    margin-top: 0;
}

/* Red guide on every page */
.global-guide {
    position: fixed;
    left: 0;
    top: 62px;
    bottom: 0;
    width: 150px;
    background: #cc181e;
    border-right: 1px solid #9e1116;
    padding: 14px 8px;
    z-index: 20;
}

.global-guide .guide-title {
    color: #ffdede;
    font-size: 11px;
    margin: 0 0 8px 7px;
}

.global-guide a {
    display: block;
    color: #fff;
    padding: 8px 8px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 2px;
}

.global-guide a:hover,
.global-guide a.active {
    background: #a91116;
    color: #fff;
    text-decoration: none;
}

/* hide old per-page guide so it does not duplicate */
.page > .guide {
    display: none;
}

.page {
    margin-left: 150px;
}

/* Home/results align after global guide */
.home-content {
    padding-left: 28px;
}

/* Old YouTube watch page: smaller centered player */
.watch-layout {
    max-width: 1180px;
    margin: 0 auto;
    grid-template-columns: 854px 300px;
    gap: 18px;
    padding: 18px 16px;
}

.watch-main {
    width: 854px;
}

.old-player {
    width: 854px;
    max-width: 854px;
    aspect-ratio: 16 / 9;
}

.related {
    width: 300px;
}

/* channel/settings pages with global guide */
.center-card {
    padding-left: 0;
}

.channel-page,
.admin-layout {
    margin-left: 0;
}

/* comment edit/delete */
.comment-body-wrap {
    flex: 1;
}

.comment-actions {
    margin-top: 4px;
}

.comment-actions button {
    border: 0;
    background: transparent;
    color: #167ac6;
    cursor: pointer;
    padding: 0;
    margin-right: 8px;
    font-size: 12px;
}

.comment-actions button:hover {
    text-decoration: underline;
}

.comment-edit-box {
    width: 100%;
    min-height: 56px;
    border: 1px solid #bbb;
    padding: 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
}

.comment-edit-controls {
    margin-top: 5px;
}

.comment-edit-controls button {
    border: 1px solid #aaa;
    background: #f6f6f6;
    color: #333;
    padding: 4px 8px;
    margin-right: 5px;
    cursor: pointer;
}

.comment-edit-controls button.save {
    background: #167ac6;
    border-color: #0f68aa;
    color: #fff;
}

@media (max-width: 1100px) {
    .watch-layout {
        display: block;
        max-width: 854px;
    }

    .watch-main,
    .old-player {
        width: 100%;
        max-width: 854px;
    }

    .related {
        width: 100%;
        margin-top: 20px;
    }
}

@media (max-width: 900px) {
    .global-guide {
        display: none;
    }

    .page {
        margin-left: 0;
    }
}


/* Layout correction: no big red fixed sidebar */
.global-guide {
    display: none !important;
}

.page {
    margin-left: 0 !important;
}

/* Show normal per-page guide again, but make its buttons red with white text */
.page > .guide {
    display: block !important;
    width: 150px;
    background: #fff;
    border-right: 1px solid #eee;
    padding: 18px 10px;
}

.guide .guide-title {
    color: #777;
    font-size: 11px;
    margin: 0 0 10px 8px;
}

.guide a {
    display: block;
    background: #cc181e;
    color: #fff !important;
    padding: 8px 9px;
    margin-bottom: 6px;
    border-radius: 2px;
    font-weight: bold;
    text-decoration: none;
}

.guide a:hover,
.guide a.active {
    background: #a91116;
    color: #fff !important;
    text-decoration: none;
}

/* Logo correction: keep it slightly right, but move it back up */
.yt-header {
    height: 56px !important;
}

.yt-header-inner {
    height: 56px !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-left: 28px !important;
}

.yt-logo {
    margin-left: 6px !important;
    margin-top: 0 !important;
}

.yt-logo img {
    width: 122px;
}

.yt-search {
    margin-top: 0 !important;
}

.yt-actions {
    margin-top: 0 !important;
}

/* Watch page moved a little left */
.watch-layout {
    max-width: 1180px !important;
    margin: 0 !important;
    grid-template-columns: 854px 300px !important;
    gap: 18px !important;
    padding: 18px 16px 18px 175px !important;
}

.watch-main {
    width: 854px !important;
}

.old-player {
    width: 854px !important;
    max-width: 854px !important;
}

/* Home pages with normal guide */
.home-content {
    padding-left: 28px !important;
}

/* Center cards should not be pushed by removed sidebar */
.center-card {
    padding-left: 0 !important;
}

@media (max-width: 1100px) {
    .watch-layout {
        display: block !important;
        padding-left: 16px !important;
        max-width: 854px !important;
        margin: 0 auto !important;
    }

    .watch-main,
    .old-player {
        width: 100% !important;
        max-width: 854px !important;
    }

    .related {
        width: 100% !important;
        margin-top: 20px;
    }
}

@media (max-width: 900px) {
    .page > .guide {
        display: none !important;
    }
}


/* Final all-pages left menu + watch alignment correction */
.global-guide {
    display: block !important;
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    width: 150px;
    background: #fff !important;
    border-right: 1px solid #eee;
    padding: 18px 10px;
    z-index: 20;
}

.global-guide .guide-title {
    color: #777 !important;
    font-size: 11px;
    margin: 0 0 10px 8px;
    font-weight: normal;
}

.global-guide a {
    display: block;
    background: #cc181e;
    color: #fff !important;
    padding: 8px 9px;
    margin-bottom: 6px;
    border-radius: 2px;
    font-weight: bold;
    text-decoration: none;
}

.global-guide a:hover,
.global-guide a.active {
    background: #a91116;
    color: #fff !important;
    text-decoration: none;
}

/* Hide old per-page guide to avoid duplicates */
.page > .guide {
    display: none !important;
}

/* All pages leave room for the global guide */
.page {
    margin-left: 150px !important;
}

/* Header stays normal */
.yt-header {
    height: 56px !important;
}

.yt-header-inner {
    height: 56px !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-left: 28px !important;
}

.yt-logo {
    margin-left: 6px !important;
    margin-top: 0 !important;
}

.yt-logo img {
    width: 122px;
}

/* Move watch area slightly to the right from the previous fix */
.watch-layout {
    max-width: 1180px !important;
    margin: 0 !important;
    grid-template-columns: 854px 300px !important;
    gap: 18px !important;
    padding: 18px 16px 18px 42px !important;
}

.watch-main {
    width: 854px !important;
}

.old-player {
    width: 854px !important;
    max-width: 854px !important;
}

.related {
    width: 300px;
}

/* Other pages use the same all-pages left guide spacing */
.home-content {
    padding-left: 28px !important;
}

.center-card {
    padding-left: 0 !important;
}

.channel-page,
.admin-layout {
    margin-left: 0 !important;
}

@media (max-width: 1100px) {
    .watch-layout {
        display: block !important;
        padding-left: 16px !important;
        max-width: 854px !important;
        margin: 0 auto !important;
    }

    .watch-main,
    .old-player {
        width: 100% !important;
        max-width: 854px !important;
    }

    .related {
        width: 100% !important;
        margin-top: 20px;
    }
}

@media (max-width: 900px) {
    .global-guide {
        display: none !important;
    }

    .page {
        margin-left: 0 !important;
    }
}


/* Upload generated thumbnail preview */
.upload-preview {
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid #ddd;
    background: #f7f7f7;
    padding: 10px;
    margin: 10px 0;
}

.upload-preview video {
    display: none;
}

.upload-preview canvas {
    width: 160px;
    height: 90px;
    background: #ddd;
    border: 1px solid #ccc;
}


/* Fixed channel profile page */
.channel-profile-page {
    padding: 20px 28px 40px !important;
    width: auto !important;
    max-width: 1280px;
}

.channel-cover {
    height: 165px;
    width: 100%;
    background-color: #111;
    background-size: cover;
    background-position: center center;
    border: 1px solid #222;
    overflow: hidden;
    position: relative;
}

.default-cover-pattern {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(#151515, #050505);
    background-size: 8px 8px, auto;
}

.channel-profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 0 16px;
    border-bottom: 1px solid #ddd;
}

.channel-avatar-wrap {
    width: 92px;
    height: 92px;
    border: 1px solid #ddd;
    background: #fff;
    padding: 3px;
}

.channel-avatar-large {
    width: 84px;
    height: 84px;
    object-fit: cover;
    display: block;
}

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

.channel-profile-info h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: normal;
}

.channel-profile-info p {
    margin: 0 0 7px;
    max-width: 720px;
}

.channel-profile-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.channel-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #ddd;
    margin-top: 12px;
}

.channel-tabs a {
    color: #333;
    padding: 12px 18px;
    text-decoration: none;
}

.channel-tabs a.active {
    border-bottom: 3px solid #cc181e;
    font-weight: bold;
}

.channel-video-section {
    padding-top: 18px;
}

.channel-video-card {
    position: relative;
}

.thumb-wrap {
    position: relative;
}

.thumb-wrap img {
    display: block;
}

.video-menu {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 5;
}

.video-menu-button {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(0,0,0,.35);
    background: rgba(255,255,255,.92);
    color: #333;
    font-size: 18px;
    line-height: 20px;
    cursor: pointer;
    border-radius: 2px;
    padding: 0;
}

.video-menu-button:hover {
    background: #fff;
}

.video-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 29px;
    width: 180px;
    background: #fff;
    border: 1px solid #bbb;
    box-shadow: 0 2px 7px rgba(0,0,0,.25);
    z-index: 10;
}

.video-menu.open .video-menu-dropdown {
    display: block;
}

.video-menu-dropdown a,
.video-menu-dropdown button {
    display: block;
    width: 100%;
    border: 0;
    background: #fff;
    color: #333;
    text-align: left;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
}

.video-menu-dropdown a:hover,
.video-menu-dropdown button:hover {
    background: #eee;
    text-decoration: none;
}

.video-menu-dropdown form {
    margin: 0;
}

.video-visibility-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 5px;
    background: #eee;
    border: 1px solid #ccc;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
}

.channel-about-box {
    margin-top: 24px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
    max-width: 760px;
}

.channel-about-box h2 {
    font-size: 18px;
    font-weight: normal;
}

.empty-channel {
    color: #777;
}

.edit-video-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    padding: 10px;
    margin-bottom: 15px;
}

.edit-video-preview img {
    width: 160px;
    height: 90px;
    object-fit: cover;
    background: #ddd;
}

.danger-button {
    background: #cc181e !important;
    border-color: #9e1116 !important;
    margin-top: 12px !important;
}

.danger-button:hover {
    background: #a91116 !important;
}


/* Final channel/profile alignment correction */
.global-guide {
    width: 165px !important;
    top: 56px !important;
    padding: 18px 12px !important;
}

.global-guide .guide-title {
    margin-left: 8px !important;
}

.global-guide a {
    width: 140px !important;
    padding: 8px 10px !important;
    margin-bottom: 6px !important;
}

/* If old per-page guide is used anywhere, match the same width */
.page > .guide {
    width: 165px !important;
    padding: 18px 12px !important;
}

.page > .guide a {
    width: 140px !important;
}

/* Keep content aligned after wider guide */
.page {
    margin-left: 165px !important;
}

/* Logo remains aligned visually with the left guide */
.yt-header-inner {
    padding-left: 28px !important;
}

.yt-logo {
    margin-left: 6px !important;
}

/* Channel page fixed profile spacing */
.channel-profile-page {
    padding: 18px 28px 40px !important;
    max-width: 1280px !important;
    min-width: 0 !important;
}

.channel-cover {
    height: 165px !important;
    margin-bottom: 0 !important;
}

.channel-profile-head {
    display: grid !important;
    grid-template-columns: 92px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: 110px !important;
    padding: 14px 0 18px !important;
    border-bottom: 1px solid #ddd !important;
    position: relative !important;
    overflow: visible !important;
}

.channel-avatar-wrap {
    grid-column: 1 !important;
    width: 92px !important;
    height: 92px !important;
    padding: 3px !important;
    margin: 0 !important;
    align-self: start !important;
}

.channel-avatar-large {
    width: 84px !important;
    height: 84px !important;
    display: block !important;
    object-fit: cover !important;
}

.channel-profile-info {
    grid-column: 2 !important;
    min-width: 0 !important;
    padding-top: 2px !important;
}

.channel-profile-info h1 {
    margin: 0 0 8px !important;
    line-height: 1.15 !important;
}

.channel-profile-info p {
    margin: 0 0 8px !important;
}

.channel-profile-actions {
    grid-column: 3 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: static !important;
    align-self: start !important;
    padding-top: 8px !important;
}

.channel-tabs {
    clear: both !important;
    margin-top: 12px !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Remove 3-dot menu completely */
.video-menu,
.video-menu-button,
.video-menu-dropdown {
    display: none !important;
}

/* Owner edit/delete shown directly, cleanly under thumbnail */
.video-owner-actions {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.35;
}

.video-owner-actions a {
    display: block;
    color: #167ac6;
    margin-bottom: 2px;
}

.video-owner-actions form {
    margin: 0;
}

.video-owner-actions button {
    display: inline-block;
    border: 1px solid #aaa;
    background: #f6f6f6;
    color: #333;
    font-size: 12px;
    padding: 2px 7px;
    cursor: pointer;
}

.video-owner-actions button:hover {
    background: #eee;
}

/* Better spacing between video cards when direct actions are visible */
.channel-video-card {
    padding-bottom: 8px;
}

.channel-video-card h2 {
    margin-top: 6px !important;
}

/* Keep watch position adjusted with wider menu */
.watch-layout {
    padding-left: 55px !important;
}

@media (max-width: 900px) {
    .global-guide {
        display: none !important;
    }

    .page {
        margin-left: 0 !important;
    }

    .channel-profile-head {
        display: block !important;
    }

    .channel-profile-actions {
        margin-top: 10px !important;
    }
}


/* Patch 1: video hover animation on all pages */
.video-card,
.result-video,
.related-item,
.channel-video-card,
.playlist-card,
.playlist-video-row {
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.video-card:hover,
.result-video:hover,
.related-item:hover,
.channel-video-card:hover,
.playlist-card:hover,
.playlist-video-row:hover {
    transform: translateY(-2px);
    background-color: #fafafa;
}

.video-card img,
.result-video img,
.related-item img,
.channel-video-card img,
.playlist-card img,
.playlist-video-row img {
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.video-card:hover img,
.result-video:hover img,
.related-item:hover img,
.channel-video-card:hover img,
.playlist-card:hover img,
.playlist-video-row:hover img {
    transform: scale(1.025);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
    filter: brightness(1.04);
}

.video-card:hover h2 a,
.result-video:hover h2 a,
.related-item:hover a,
.channel-video-card:hover h2 a,
.playlist-card:hover h2 a,
.playlist-video-row:hover h2 a {
    color: #cc181e;
}

/* Patch 1: Add to menu */
.addto-box {
    max-width: 460px;
}

.addto-box form {
    margin: 6px 0;
}

.addto-box button {
    border: 1px solid #aaa;
    background: #f6f6f6;
    color: #333;
    padding: 6px 10px;
    cursor: pointer;
}

.addto-box button:hover {
    background: #eee;
}

.addto-box input,
.addto-box select {
    border: 1px solid #bbb;
    padding: 6px;
    margin-right: 4px;
}

.addto-playlists {
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    margin: 8px 0;
    padding: 6px 0;
}

/* Patch 1: Playlist pages */
.playlists-page h1,
.playlist-page h1 {
    font-weight: normal;
}

.playlist-create-box {
    border: 1px solid #ddd;
    background: #f8f8f8;
    padding: 14px;
    max-width: 520px;
    margin-bottom: 20px;
}

.playlist-create-box h2 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: normal;
}

.playlist-create-box label {
    display: block;
    font-weight: bold;
    margin: 9px 0 4px;
}

.playlist-create-box input,
.playlist-create-box textarea,
.playlist-create-box select {
    width: 100%;
    border: 1px solid #bbb;
    padding: 7px;
}

.playlist-create-box button {
    margin-top: 12px;
    background: #167ac6;
    border: 1px solid #0f68aa;
    color: #fff;
    padding: 7px 12px;
    font-weight: bold;
    cursor: pointer;
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    max-width: 980px;
}

.playlist-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #ddd;
}

.playlist-header {
    display: flex;
    gap: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 16px;
    margin-bottom: 18px;
    max-width: 900px;
}

.playlist-header img {
    width: 260px;
    height: 146px;
    object-fit: cover;
    background: #ddd;
}

.playlist-header h1 {
    margin: 0 0 8px;
}

.playlist-video-list {
    max-width: 900px;
}

.ajax-remove-playlist-video button {
    border: 1px solid #aaa;
    background: #f6f6f6;
    color: #333;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

.ajax-remove-playlist-video button:hover {
    background: #eee;
}


/* Patch 2: notifications */
.notifications-link {
    position: relative;
}

.notif-badge {
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    margin-left: 4px;
    background: #cc181e;
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    text-align: center;
    font-weight: bold;
}

.notifications-page {
    max-width: 900px;
}

.notification-list {
    border: 1px solid #ddd;
    background: #fff;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 11px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item.unread {
    background: #fff7f7;
}

.notification-item img {
    width: 96px;
    height: 54px;
    object-fit: cover;
    background: #ddd;
}

.notification-item strong {
    color: #333;
}

.notification-actions {
    margin-bottom: 12px;
}

/* Patch 2: subscriptions page */
.subscriptions-feed {
    max-width: 920px;
}

.empty-feed {
    color: #777;
    border: 1px solid #ddd;
    background: #f8f8f8;
    padding: 14px;
}

/* Patch 2: cinema player */
.yt-cinema {
    width: 28px;
    font-size: 14px !important;
}

.yt-cinema.active {
    background: #333 !important;
}

.watch-layout.cinema-mode {
    display: block !important;
    max-width: 1050px !important;
    margin: 0 auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.watch-layout.cinema-mode .watch-main {
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
}

.watch-layout.cinema-mode .old-player {
    width: 100% !important;
    max-width: 1000px !important;
}

.watch-layout.cinema-mode .related {
    display: block !important;
    max-width: 1000px !important;
    margin: 18px auto 0 !important;
}

.watch-layout.cinema-mode .related .related-item {
    display: inline-flex !important;
    width: 300px !important;
    margin-right: 14px !important;
    vertical-align: top !important;
}

.watch-layout.cinema-mode .video-info-row,
.watch-layout.cinema-mode .tabs,
.watch-layout.cinema-mode .share-box,
.watch-layout.cinema-mode .description-box,
.watch-layout.cinema-mode .comments {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}


/* Patch 3: report video */
.report-box select,
.report-box textarea {
    width: 100%;
    border: 1px solid #bbb;
    padding: 7px;
    margin: 5px 0 9px;
}

.report-box button {
    border: 1px solid #aaa;
    background: #f6f6f6;
    color: #333;
    padding: 6px 10px;
    cursor: pointer;
}

.report-box button:hover {
    background: #eee;
}

/* Patch 3: cumulative rewards */
.channel-rewards {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.reward-badge {
    display: inline-block;
    min-width: 38px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    color: #fff;
    border: 1px solid rgba(0,0,0,.25);
    text-shadow: 0 1px 1px rgba(0,0,0,.5);
}

.reward-silver {
    background: linear-gradient(#9b9b9b, #6f6f6f);
}

.reward-gold {
    background: linear-gradient(#f0c14b, #b8860b);
}

.reward-gold-special {
    background: linear-gradient(#fff1a8, #d4af37 45%, #8a6500);
    box-shadow: 0 0 6px rgba(212, 175, 55, .7);
}

/* Patch 3: admin reports */
.admin-report-card {
    display: flex;
    gap: 14px;
    border-top: 1px solid #ddd;
    padding: 14px 0;
}

.admin-report-thumb img {
    width: 180px;
    height: 101px;
    object-fit: cover;
    background: #ddd;
}

.admin-report-body {
    flex: 1;
}

.admin-report-body h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: normal;
}

.admin-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.admin-report-actions form {
    margin: 0;
}

.admin-report-actions button {
    border: 1px solid #aaa;
    background: #f6f6f6;
    color: #333;
    padding: 6px 10px;
    cursor: pointer;
}

.admin-report-actions button:hover {
    background: #eee;
}


/* Verified channel badge auto 100 subscribers */
.verified {
    display: inline-block;
    margin-left: 4px;
    width: 15px;
    height: 15px;
    line-height: 15px;
    border-radius: 50%;
    background: #167ac6;
    color: #fff !important;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    text-decoration: none !important;
    vertical-align: middle;
}


/* Delete channel shared login patch */
.danger-link,
.danger-note a {
    background: #cc181e !important;
    border-color: #9e1116 !important;
    color: #fff !important;
}

.danger-note a {
    display: inline-block;
    padding: 6px 10px;
    text-decoration: none;
}

/* Final cinema mode Up Next fix */
.watch-layout.cinema-mode {
    display: grid !important;
    grid-template-columns: minmax(760px, 1fr) 320px !important;
    gap: 22px !important;
    max-width: 1280px !important;
    margin: 0 auto !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
}

.watch-layout.cinema-mode .watch-main {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.watch-layout.cinema-mode .old-player {
    width: 100% !important;
    max-width: none !important;
}

.watch-layout.cinema-mode .related {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 320px !important;
    max-width: 320px !important;
    margin: 0 !important;
}

.watch-layout.cinema-mode .related .related-item {
    display: flex !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    vertical-align: top !important;
}

@media (max-width: 1150px) {
    .watch-layout.cinema-mode {
        display: block !important;
        max-width: 1000px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .watch-layout.cinema-mode .related {
        display: block !important;
        width: 100% !important;
        max-width: 1000px !important;
        margin: 18px auto 0 !important;
    }

    .watch-layout.cinema-mode .related .related-item {
        display: inline-flex !important;
        width: 300px !important;
        margin-right: 14px !important;
        margin-bottom: 12px !important;
    }
}


/* Safe color fade animation for ✦ button */
.old-player.color-fade-enabled .yt-progress-played,
.old-player.color-fade-enabled [data-progress-bar] {
    background: linear-gradient(90deg, #cc181e, #ff2b2b, #c7b33a, #827d2b, #cc181e) !important;
    background-size: 500% 100% !important;
    animation: oldytStrongColorFade 2.7s linear infinite !important;
    box-shadow: 0 0 4px rgba(255, 43, 43, .95), 0 0 9px rgba(199, 179, 58, .8) !important;
}

.old-player.color-fade-enabled .yt-volume-level,
.old-player.color-fade-enabled [data-volume-level] {
    background: linear-gradient(90deg, #cc181e, #ff2b2b, #c7b33a, #827d2b, #cc181e) !important;
    background-size: 500% 100% !important;
    animation: oldytStrongColorFade 2.7s linear infinite !important;
    box-shadow: 0 0 4px rgba(255, 43, 43, .95), 0 0 8px rgba(199, 179, 58, .75) !important;
}

.old-player.color-fade-enabled .yt-progress-handle,
.old-player.color-fade-enabled [data-progress-handle] {
    background: #f3e37c !important;
    border-color: #fff !important;
    animation: oldytStrongGlowFade 1.8s ease-in-out infinite !important;
}

.old-player.color-fade-enabled .yt-mute,
.old-player.color-fade-enabled [data-mute] {
    color: #f3e37c !important;
    text-shadow: 0 0 4px rgba(255,255,255,.9), 0 0 9px rgba(199,179,58,.95) !important;
    animation: oldytStrongIconFade 2.7s ease-in-out infinite !important;
}

.old-player.color-fade-enabled .yt-hd,
.old-player.color-fade-enabled .yt-hd.active,
.old-player.color-fade-enabled [data-hd-indicator] {
    background: linear-gradient(180deg, #ff2b2b, #cc181e, #827d2b) !important;
    color: #fff !important;
    border-color: #fff !important;
    animation: oldytStrongGlowFade 1.8s ease-in-out infinite !important;
}

.old-player.color-fade-enabled .yt-color-fade {
    color: #f3e37c !important;
    text-shadow: 0 0 5px rgba(255,255,255,.85), 0 0 11px rgba(199,179,58,1) !important;
}

@keyframes oldytStrongColorFade {
    0% { background-position: 0% 50%; filter: brightness(1); }
    25% { background-position: 50% 50%; filter: brightness(1.35); }
    50% { background-position: 100% 50%; filter: brightness(1.12); }
    75% { background-position: 50% 50%; filter: brightness(1.35); }
    100% { background-position: 0% 50%; filter: brightness(1); }
}

@keyframes oldytStrongGlowFade {
    0% { box-shadow: 0 0 4px rgba(204,24,30,.95), 0 0 8px rgba(204,24,30,.7); }
    50% { box-shadow: 0 0 5px rgba(199,179,58,1), 0 0 13px rgba(199,179,58,.9); }
    100% { box-shadow: 0 0 4px rgba(204,24,30,.95), 0 0 8px rgba(204,24,30,.7); }
}

@keyframes oldytStrongIconFade {
    0% { color: #fff; text-shadow: 0 0 5px rgba(204,24,30,.95); }
    50% { color: #f3e37c; text-shadow: 0 0 10px rgba(199,179,58,1); }
    100% { color: #fff; text-shadow: 0 0 5px rgba(204,24,30,.95); }
}



/* Search suggestions - Doodle style */
.yt-search {
    position: relative !important;
    z-index: 30000 !important;
}

.yt-search input[data-search-input] {
    position: relative !important;
    z-index: 30002 !important;
}

.yt-search-suggestions {
    position: absolute !important;
    left: 0 !important;
    top: 31px !important;
    width: calc(100% - 74px) !important;
    background: #fff !important;
    border: 1px solid #c9c9c9 !important;
    border-top: 0 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,.22) !important;
    z-index: 30001 !important;
    display: none;
    font-family: Arial, Helvetica, sans-serif !important;
}

.yt-suggestion-row {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    height: 31px !important;
    padding: 0 9px !important;
    color: #111 !important;
    background: #fff !important;
    cursor: pointer !important;
    font-size: 13px !important;
    line-height: 31px !important;
}

.yt-suggestion-row:hover,
.yt-suggestion-row.active {
    background: #f1f1f1 !important;
}

.yt-suggestion-icon {
    width: 15px !important;
    color: #777 !important;
    font-size: 14px !important;
    flex: 0 0 auto !important;
}

.yt-suggestion-text {
    flex: 1 1 auto !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.yt-suggestion-kind {
    flex: 0 0 auto !important;
    color: #777 !important;
    font-size: 11px !important;
}


/* Comment edit/delete buttons */
.comment-actions {
    margin-top: 4px;
}

.comment-actions button {
    border: 0;
    background: transparent;
    color: #167ac6;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    margin-right: 8px;
}

.comment-actions button:hover {
    text-decoration: underline;
}


/* FINAL FIX: duration badge must stay on top of thumbnail */
.thumb-wrap {
    position: relative !important;
    display: block !important;
    overflow: hidden !important;
    background: #ddd !important;
    line-height: 0 !important;
}

.thumb-wrap img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.thumb-duration {
    position: absolute !important;
    right: 4px !important;
    bottom: 4px !important;
    z-index: 50 !important;

    display: inline-block !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;

    margin: 0 !important;
    padding: 1px 4px !important;

    background: rgba(0, 0, 0, .88) !important;
    color: #fff !important;

    border-radius: 2px !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 11px !important;
    font-weight: bold !important;
    line-height: 14px !important;
    text-align: center !important;
    white-space: nowrap !important;
    text-shadow: 0 1px 1px rgba(0,0,0,.85) !important;
}

/* sizes for every page */
.video-card .thumb-wrap {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
}

.result-video > a .thumb-wrap,
.playlist-video-row > a .thumb-wrap {
    width: 196px !important;
    height: 110px !important;
}

.related-item > a .thumb-wrap {
    width: 128px !important;
    height: 72px !important;
}

.related-item > a .thumb-duration {
    right: 3px !important;
    bottom: 3px !important;
    font-size: 10px !important;
    line-height: 13px !important;
}

/* FINAL FIX: converter page layout */
.converter-page {
    align-items: flex-start !important;
    padding-top: 40px !important;
}

.converter-card {
    width: 620px !important;
    max-width: 620px !important;
    margin-top: 20px !important;
    overflow: visible !important;
}

.converter-result {
    margin-top: 22px !important;
    border-top: 1px solid #ddd !important;
    padding-top: 18px !important;
    clear: both !important;
}

.converter-video {
    display: flex !important;
    gap: 16px !important;
    align-items: flex-start !important;
    width: 100% !important;
    overflow: visible !important;
}

.converter-video .thumb-wrap {
    width: 230px !important;
    height: 129px !important;
    flex: 0 0 230px !important;
}

.converter-video > div {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.converter-video h2 {
    display: block !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
    font-weight: normal !important;
    margin: 0 0 6px 0 !important;
    word-break: normal !important;
}

.converter-actions {
    margin-top: 18px !important;
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    clear: both !important;
}

.converter-download {
    display: inline-block !important;
    padding: 8px 13px !important;
    border: 1px solid #0f68aa !important;
    background: #167ac6 !important;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: bold !important;
    line-height: 16px !important;
}

.converter-download.mp3 {
    background: #cc181e !important;
    border-color: #a9151a !important;
}

@media (max-width: 700px) {
    .converter-card {
        width: calc(100% - 30px) !important;
        max-width: calc(100% - 30px) !important;
    }

    .converter-video {
        display: block !important;
    }

    .converter-video .thumb-wrap {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
        margin-bottom: 10px !important;
    }

    .result-video > a .thumb-wrap,
    .playlist-video-row > a .thumb-wrap {
        width: 160px !important;
        height: 90px !important;
    }
}


/* Final pre-backup fixes */

/* Keep sticky header above every thumbnail duration badge. */
.yt-header {
    z-index: 10000 !important;
}

.thumb-duration {
    z-index: 6 !important;
}

/* Channel owner edit/delete must stay visible below thumbnail. */
.channel-thumb-actions-wrap {
    display: block !important;
    overflow: visible !important;
}

.channel-thumb-link {
    display: block !important;
}

.channel-thumb-link .thumb-wrap {
    overflow: hidden !important;
}

.channel-video-card .video-owner-actions {
    display: block !important;
    position: static !important;
    z-index: 1 !important;
    margin-top: 5px !important;
    line-height: 1.35 !important;
}

/* Autoplay next overlay */
.autoplay-next-box {
    position: absolute;
    right: 12px;
    bottom: 46px;
    z-index: 40;
    width: 220px;
    padding: 10px;
    background: rgba(0, 0, 0, .86);
    color: #fff;
    border-radius: 2px;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,.55);
}

.autoplay-next-title {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 8px;
}

.autoplay-next-actions {
    display: flex;
    gap: 6px;
}

.autoplay-next-actions button {
    border: 1px solid #888;
    background: #f6f6f6;
    color: #111;
    font-size: 12px;
    padding: 4px 7px;
    cursor: pointer;
}

.autoplay-next-actions button:hover {
    background: #fff;
}


/* Autoplay next video panel */
.oldyt-autoplay-panel {
    position: fixed;
    right: 24px;
    bottom: 28px;
    z-index: 50000;
    display: none;
    width: 250px;
    border: 1px solid #333;
    background: rgba(20, 20, 20, .94);
    color: #fff;
    padding: 12px;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 2px 12px rgba(0,0,0,.55);
}

.oldyt-autoplay-panel.show {
    display: block;
}

.oldyt-autoplay-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 9px;
}

.oldyt-autoplay-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.oldyt-autoplay-actions button {
    background: #167ac6;
    border: 1px solid #0f68aa;
    color: #fff;
    font-weight: bold;
    padding: 5px 8px;
    cursor: pointer;
}

.oldyt-autoplay-actions label {
    font-size: 12px;
    color: #ddd;
}


/* Subscribe button final state */
.subscribe-btn.subscribed,
button.subscribe-btn.subscribed,
.ajax-subscribe-form .subscribe-btn.subscribed {
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #999 !important;
    text-shadow: none !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85) !important;
}

.subscribe-btn.subscribed:hover,
button.subscribe-btn.subscribed:hover,
.ajax-subscribe-form .subscribe-btn.subscribed:hover {
    background: #f5f5f5 !important;
    color: #111 !important;
}

/* Autoplay popup centered over the player */
.oldyt-autoplay-panel {
    position: fixed !important;
    left: 50% !important;
    top: 42% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    z-index: 70000 !important;
    width: 280px !important;
    border: 1px solid #222 !important;
    background: rgba(18, 18, 18, .96) !important;
    color: #fff !important;
    padding: 14px !important;
    font-family: Arial, Helvetica, sans-serif !important;
    box-shadow: 0 3px 18px rgba(0,0,0,.75) !important;
    text-align: left !important;
}

.oldyt-autoplay-panel.show {
    display: block !important;
}

.oldyt-autoplay-title {
    font-size: 15px !important;
    font-weight: bold !important;
    margin-bottom: 10px !important;
}

.oldyt-autoplay-actions {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex-wrap: wrap !important;
}

.oldyt-autoplay-actions button {
    background: #167ac6 !important;
    border: 1px solid #0f68aa !important;
    color: #fff !important;
    font-weight: bold !important;
    padding: 5px 8px !important;
    cursor: pointer !important;
}

.oldyt-autoplay-actions button[data-autoplay-cancel] {
    background: #333 !important;
    border-color: #555 !important;
}

.oldyt-autoplay-actions label {
    font-size: 12px !important;
    color: #ddd !important;
}


/* Reliable centered autoplay popup final positioning */
.oldyt-autoplay-panel {
    position: absolute !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 90000 !important;
    display: none;
    width: 280px !important;
    border: 1px solid #222 !important;
    background: rgba(18, 18, 18, .96) !important;
    color: #fff !important;
    padding: 14px !important;
    font-family: Arial, Helvetica, sans-serif !important;
    box-shadow: 0 3px 18px rgba(0,0,0,.75) !important;
    text-align: left !important;
}

.oldyt-autoplay-panel.show {
    display: block !important;
}

.oldyt-autoplay-title {
    font-size: 15px !important;
    font-weight: bold !important;
    margin-bottom: 10px !important;
}

.oldyt-autoplay-actions {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex-wrap: wrap !important;
}

.oldyt-autoplay-actions button {
    background: #167ac6 !important;
    border: 1px solid #0f68aa !important;
    color: #fff !important;
    font-weight: bold !important;
    padding: 5px 8px !important;
    cursor: pointer !important;
}

.oldyt-autoplay-actions button[data-autoplay-cancel] {
    background: #333 !important;
    border-color: #555 !important;
}

.oldyt-autoplay-actions label {
    font-size: 12px !important;
    color: #ddd !important;
}


/* FINAL autoplay panel always shown at end, centered over player */
.oldyt-autoplay-panel.oldyt-autoplay-final {
    position: absolute !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 95000 !important;
    display: none;
    width: 280px !important;
    border: 1px solid #222 !important;
    background: rgba(18, 18, 18, .96) !important;
    color: #fff !important;
    padding: 14px !important;
    font-family: Arial, Helvetica, sans-serif !important;
    box-shadow: 0 3px 18px rgba(0,0,0,.75) !important;
    text-align: left !important;
}

.oldyt-autoplay-panel.oldyt-autoplay-final.show {
    display: block !important;
}

.oldyt-autoplay-final .oldyt-autoplay-title {
    font-size: 15px !important;
    font-weight: bold !important;
    margin-bottom: 10px !important;
}

.oldyt-autoplay-final .oldyt-autoplay-actions {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex-wrap: wrap !important;
}

.oldyt-autoplay-final .oldyt-autoplay-actions button {
    background: #167ac6 !important;
    border: 1px solid #0f68aa !important;
    color: #fff !important;
    font-weight: bold !important;
    padding: 5px 8px !important;
    cursor: pointer !important;
}

.oldyt-autoplay-final .oldyt-autoplay-actions button[data-autoplay-cancel] {
    background: #333 !important;
    border-color: #555 !important;
}

.oldyt-autoplay-final .oldyt-autoplay-actions label {
    font-size: 12px !important;
    color: #ddd !important;
}


/* TRUE center autoplay popup inside player */
.old-player,
[data-player] {
    position: relative !important;
}

.old-player .oldyt-autoplay-panel.inside-player-center,
[data-player] .oldyt-autoplay-panel.inside-player-center {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    z-index: 99999 !important;
    width: 280px !important;
}

.old-player .oldyt-autoplay-panel.inside-player-center.show,
[data-player] .oldyt-autoplay-panel.inside-player-center.show {
    display: block !important;
}


/* SAFE Next video popup centered inside player */
.oldyt-autoplay-host-safe {
    position: relative !important;
}

.oldyt-autoplay-host-safe .oldyt-autoplay-panel.oldyt-autoplay-inside-player-safe {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    z-index: 90 !important;
}


/* The Old YouTube embed player */
body.embed-page {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000 !important;
}

.embed-page .embed-player,
.embed-page .old-player {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    background: #000 !important;
    position: relative !important;
}

.embed-page .old-player video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #000 !important;
}

.embed-page .player-controls {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

.embed-page .big-play {
    z-index: 25 !important;
}

.embed-page .yt-settings-panel {
    z-index: 40 !important;
}

.embed-page .oldyt-autoplay-panel {
    display: none !important;
}


/* Fix: do not block page scroll outside embed */
body:not(.embed-page) {
    overflow: auto !important;
}


/* Embed title/channel overlay + Watch button */
.embed-page .embed-watch-info {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 35;
    max-width: calc(100% - 80px);
    padding: 6px 8px;
    color: #fff !important;
    text-decoration: none !important;
    font-family: Arial, sans-serif;
    background: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,.35));
    text-shadow: 0 1px 2px #000;
    opacity: .95;
}

.embed-page .embed-watch-info strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 16px;
    color: #fff !important;
}

.embed-page .embed-watch-info span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-top: 1px;
    font-size: 11px;
    line-height: 14px;
    color: #ddd !important;
}

.embed-page .embed-player:hover .embed-watch-info {
    opacity: 1;
}

.embed-page .yt-watch-link {
    display: inline-block;
    height: 22px;
    line-height: 22px;
    padding: 0 7px;
    margin-right: 6px;
    color: #fff !important;
    text-decoration: none !important;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #333;
    background: linear-gradient(to bottom, #454545, #111);
    text-shadow: 0 -1px 0 #000;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

.embed-page .yt-watch-link:hover {
    background: linear-gradient(to bottom, #555, #1b1b1b);
}

.embed-page .yt-watch-link:active {
    background: #111;
    transform: translateY(1px);
}


/* Embed title/channel overlay final tweak: no black box, fades with controls */
.embed-page .embed-watch-info {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    text-shadow: 0 1px 3px #000, 0 0 4px #000 !important;
    opacity: 0 !important;
    transition: opacity .18s ease !important;
    pointer-events: auto;
}

.embed-page .embed-player:hover .embed-watch-info,
.embed-page .embed-player:focus-within .embed-watch-info,
.embed-page .old-player:hover .embed-watch-info,
.embed-page .old-player:focus-within .embed-watch-info {
    opacity: 1 !important;
}

/* While the video is idle at the poster, keep the title visible with the big play button */
.embed-page .old-player:not(.is-playing) .embed-watch-info {
    opacity: 1 !important;
}


/* Embed title/channel follows player controls exactly */
.embed-page .embed-watch-info {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity .18s ease, visibility .18s ease !important;
}

/* Show together with controls on mouse/focus */
.embed-page .old-player:hover .embed-watch-info,
.embed-page .old-player:focus-within .embed-watch-info,
.embed-page .embed-player:hover .embed-watch-info,
.embed-page .embed-player:focus-within .embed-watch-info {
    opacity: 1 !important;
    visibility: visible !important;
}

/* If player JS uses common active/showing classes, follow them too */
.embed-page .old-player.show-controls .embed-watch-info,
.embed-page .old-player.controls-visible .embed-watch-info,
.embed-page .old-player.is-idle .embed-watch-info,
.embed-page .old-player.is-paused .embed-watch-info,
.embed-page .old-player:not(.is-playing) .embed-watch-info {
    opacity: 1 !important;
    visibility: visible !important;
}

/* If controls are explicitly hidden, title/channel must be hidden too */
.embed-page .old-player.hide-controls .embed-watch-info,
.embed-page .old-player.controls-hidden .embed-watch-info,
.embed-page .old-player.is-playing:not(:hover):not(:focus-within) .embed-watch-info {
    opacity: 0 !important;
    visibility: hidden !important;
}


/* Normal watch player title/channel overlay */
.watch-main .old-player .watch-player-info {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 35;
    max-width: calc(100% - 80px);
    padding: 0 !important;
    color: #fff !important;
    font-family: Arial, sans-serif;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: 0 1px 3px #000, 0 0 4px #000 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
    pointer-events: none;
}

.watch-main .old-player .watch-player-info strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 16px;
    color: #fff !important;
}

.watch-main .old-player .watch-player-info span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-top: 1px;
    font-size: 11px;
    line-height: 14px;
    color: #ddd !important;
}

/* Show with controls/mouse movement */
.watch-main .old-player:hover .watch-player-info,
.watch-main .old-player:focus-within .watch-player-info,
.watch-main .old-player.show-controls .watch-player-info,
.watch-main .old-player.controls-visible .watch-player-info,
.watch-main .old-player.is-idle .watch-player-info,
.watch-main .old-player.is-paused .watch-player-info,
.watch-main .old-player:not(.is-playing) .watch-player-info {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hide together with controls while playing */
.watch-main .old-player.hide-controls .watch-player-info,
.watch-main .old-player.controls-hidden .watch-player-info,
.watch-main .old-player.is-playing:not(:hover):not(:focus-within) .watch-player-info {
    opacity: 0 !important;
    visibility: hidden !important;
}
