* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #0f0f0f;
    color: #f1f1f1;
    font-family: "Roboto", sans-serif;
    animation: page-fade-in 0.22s ease both;
}

@keyframes page-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body {
    min-height: 100vh;
}

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

button,
input,
select,
textarea {
    font: inherit;
}


img {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

/* topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    background: #0f0f0f;
    border-bottom: 1px solid #1f1f1f;
}

.topbar-left,
.topbar-center,
.topbar-right {
    display: flex;
    align-items: center;
}

.topbar-left {
    min-width: 170px;
}

.topbar-center {
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.topbar-right {
    min-width: 120px;
    justify-content: flex-end;
    gap: 12px;
}

.logo-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #4f46e5 100%);
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-item.is-active {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.logo-badge svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1.5px;
    white-space: nowrap;
    background: linear-gradient(135deg, #c084fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-form {
    width: 100%;
    max-width: 640px;
    display: flex;
    align-items: center;
    border: 1px solid #303030;
    border-radius: 999px;
    overflow: hidden;
    background: #121212;
}

.search-form input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 16px;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
}

.search-btn {
    width: 64px;
    height: 40px;
    border: none;
    border-left: 1px solid #303030;
    background: #222;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

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

.search-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: transparent;
    transition: background 0.18s ease;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: #222;
}

.icon-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.profile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4e45, #ff8a00);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

/* channel search results */
.channel-results {
    margin-bottom: 24px;
}

.channel-results-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}

.channel-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ch-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    transition: background 0.15s;
}

.ch-card:hover { background: #222; }

.ch-card-link {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.ch-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4e45, #ff8a00);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ch-card-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ch-card-avatar-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.ch-card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ch-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-card-meta {
    font-size: 13px;
    color: #9aa0a6;
}

.ch-card-sub-btn {
    flex-shrink: 0;
    height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid #555;
    background: transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.ch-card-sub-btn:hover { background: #333; }

.ch-card-sub-btn.is-subscribed {
    background: #272727;
    border-color: #444;
    color: #aaa;
}

/* subscription feed page */
.sub-feed-content {
    flex: 1;
    min-width: 0;
}

.sub-feed-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px;
}

.sub-feed-empty {
    padding: 60px 24px;
    text-align: center;
    color: #9aa0a6;
}

.sub-feed-empty-icon {
    font-size: 48px;
    margin: 0 0 16px;
}

.sub-feed-empty h3 {
    font-size: 20px;
    color: #fff;
    margin: 0 0 10px;
}

.sub-feed-empty p {
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 20px;
}

.sub-feed-empty-btn {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 20px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

/* subscription sidebar */
.sidebar-sub-title {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 4px 12px 8px;
}

.sub-sidebar-avatar {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    overflow: hidden;
    background: linear-gradient(135deg, #ff4e45, #ff8a00);
    flex-shrink: 0;
}

.sub-sidebar-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sub-sidebar-avatar-text {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

/* comment like button */
.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: #aaa;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 13px;
    border-radius: 4px;
    transition: color 0.15s;
}

.comment-like-btn:hover {
    color: #fff;
}

.comment-like-btn.is-liked {
    color: #a78bfa;
}

.comment-like-btn.is-liked svg {
    fill: #a78bfa;
}

/* infinite scroll loader */
.scroll-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 24px;
}

.scroll-loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    animation: dot-bounce 1.2s infinite ease-in-out;
}

.scroll-loader-dot:nth-child(2) { animation-delay: 0.2s; }
.scroll-loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1; }
}

/* notification bell */
.notif-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.notif-btn {
    position: relative;
    border: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.18s ease;
}

.notif-btn:hover {
    background: #222;
}

.notif-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.notif-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 300;
    overflow: hidden;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.notif-read-all {
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

.notif-read-all:hover {
    color: #c4b5fd;
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #2a2a2a;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.notif-item.unread {
    background: rgba(168, 85, 247, 0.07);
}

@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    15%       { transform: rotate(18deg); }
    30%       { transform: rotate(-15deg); }
    45%       { transform: rotate(12deg); }
    60%       { transform: rotate(-8deg); }
    75%       { transform: rotate(5deg); }
    90%       { transform: rotate(-3deg); }
}

.notif-bell-ring svg {
    transform-origin: top center;
    animation: bell-ring 0.65s ease-in-out;
}

.notif-delete-btn {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.notif-item:hover .notif-delete-btn {
    opacity: 1;
}

.notif-delete-btn:hover {
    color: #e53935;
    background: rgba(229, 57, 53, 0.1);
}

.notif-thumb-wrap {
    position: relative;
    flex-shrink: 0;
}

.notif-thumb {
    width: 60px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    background: #333;
}

.notif-type-icon {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1f1f1f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 1px solid #333;
}

.notif-msg {
    flex: 1;
    font-size: 13px;
    color: #d1d5db;
    line-height: 1.4;
}

.notif-time {
    font-size: 11px;
    color: #6b7280;
    margin-top: 3px;
}

.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

/* 댓글 서브뷰 */
.notif-comment-view {
    display: flex;
    flex-direction: column;
}

.notif-comment-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #2a2a2a;
}

.notif-back-btn {
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.notif-back-btn:hover { color: #c4b5fd; }

.notif-go-video {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
}

.notif-go-video:hover { color: #9ca3af; }

.notif-comment-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-comment-item {
    padding: 10px 16px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.notif-comment-item:last-child { border-bottom: none; }

.notif-comment-author {
    font-size: 12px;
    font-weight: 700;
    color: #c4b5fd;
}

.notif-comment-text {
    font-size: 13px;
    color: #e5e7eb;
    line-height: 1.4;
}

.notif-comment-time {
    font-size: 11px;
    color: #6b7280;
}

.notif-comment-loading,
.notif-comment-empty {
    padding: 24px 16px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

/* common main */
.main {
    padding: 24px 24px 36px;
}

/* video grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px 16px;
}

.card {
    min-width: 0;
}

.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.thumbnail-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #181818;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.22s ease;
}

/* 썸네일 호버 미리보기 (video 또는 YouTube iframe) */
.thumbnail-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    background: #000;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 1;
    pointer-events: none;
}

.thumbnail-preview.is-visible {
    opacity: 1;
}

/* 미리보기 재생 진행바 (하단, 유튜브 스타일) — 클릭·드래그로 seek */
.thumbnail-preview-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.28);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.25s ease, height 0.12s ease;
    pointer-events: auto;   /* 클릭·드래그로 재생 위치 이동 */
    cursor: pointer;
    touch-action: none;     /* 드래그 시 페이지 스크롤 방지 */
}

/* 얇은 바 위쪽으로 넉넉한 클릭 히트 영역 확장 (조준 쉽게) */
.thumbnail-preview-progress::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -9px;
    height: 16px;
}

.thumbnail-preview-progress.is-visible {
    opacity: 1;
}

.thumbnail-preview-progress:hover {
    height: 6px;
}

.thumbnail-preview-progress > i {
    position: relative;
    display: block;
    height: 100%;
    width: 0;
    background: #f00;
}

/* 진행 위치를 잡는 손잡이(스크러버) — 바에 호버 시 표시 */
.thumbnail-preview-progress > i::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f00;
    transform: translateY(-50%) scale(0);
    transition: transform 0.12s ease;
}

.thumbnail-preview-progress:hover > i::after {
    transform: translateY(-50%) scale(1);
}

/* 미리보기 위에도 재생시간·진행바·재생목록 버튼이 보이도록 */
.thumbnail-wrap .duration,
.thumbnail-wrap .card-progress-bar,
.thumbnail-wrap .card-pl-btn {
    z-index: 2;
}

.card:hover .thumbnail-image {
    transform: scale(1.03);
}

.duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    font-weight: 500;
}

.meta {
    display: flex;
    gap: 12px;
    padding-top: 12px;
}

.avatar-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #222;
}

.text {
    min-width: 0;
}

.text h3 {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.45;
    color: #f1f1f1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.channel-name,
.video-info {
    margin: 0;
    color: #aaaaaa;
    font-size: 14px;
    line-height: 1.45;
}

/* watch */
.watch-page {
    padding: 24px 24px 40px;
}

.watch-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* 화면 폭에 비례하는 유동 비율: 플레이어 75% : 추천영상 25% (모니터 해상도에 맞게 함께 늘어남) */
.watch-main-column {
    flex: 75 1 0;
    min-width: 0;
}

.watch-side-column {
    flex: 25 1 0;
    min-width: 0;
}

.player-box {
    width: 100%;
    background: #000;
    border-radius: 18px;
    line-height: 0;
    position: relative;
}

.player-box img {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border-radius: 18px;
    object-fit: cover;
}

.player-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: #000;
    object-fit: contain;
    object-position: center;
}

.player-iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border: none;
    border-radius: 18px;
}

/* Custom Player */
.custom-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    line-height: 0;
}

.custom-player:fullscreen {
    border-radius: 0;
    aspect-ratio: unset;
    height: 100%;
}

.custom-player:fullscreen .player-video {
    height: 100%;
    aspect-ratio: unset;
    object-fit: contain;
}

.cp-thumb-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
}

.cp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 12px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    border-radius: 0 0 18px 18px;
    opacity: 0;
    transition: opacity 0.2s;
    line-height: normal;
    z-index: 2;
}

.custom-player:hover .cp-controls,
.custom-player.show-controls .cp-controls {
    opacity: 1;
}

.cp-progress-wrap {
    position: relative;
    margin-bottom: 6px;
}

.cp-time-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: rgba(28,28,28,0.92);
    color: #fff;
    font-size: 12px;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
}

.cp-time-tooltip.is-visible {
    opacity: 1;
}

.cp-progress {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.cp-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.cp-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cp-bar-left, .cp-bar-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cp-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px 6px;
    border-radius: 4px;
    line-height: 0;
    display: flex;
    align-items: center;
}

.cp-btn:hover {
    background: rgba(255,255,255,0.15);
}

.cp-time {
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    padding: 0 6px;
    font-variant-numeric: tabular-nums;
}

.cp-vol-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cp-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.cp-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}


.watch-title {
    margin: 18px 0 14px;
    font-size: 22px;
    line-height: 1.4;
    letter-spacing: -0.2px;
    word-break: break-word;
}

.watch-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.watch-channel-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.watch-channel-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #222;
    flex-shrink: 0;
}

.watch-channel-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.watch-channel-text strong {
    font-size: 15px;
    line-height: 1.3;
}

.watch-channel-text span {
    font-size: 13px;
    color: #aaaaaa;
    line-height: 1.3;
}

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

.watch-action-btn {
    height: 38px;
    padding: 0 14px;
    border: 1px solid #303030;
    border-radius: 999px;
    background: #272727;
    color: #fff;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.watch-action-btn:hover {
    background: #343434;
}

.watch-action-btn.primary {
    background: #fff;
    color: #111;
    border-color: #fff;
    font-weight: 700;
}

.watch-action-btn.active {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

.watch-description {
    margin-top: 14px;
    background: #181818;
    border-radius: 14px;
    padding: 14px 16px;
    color: #f1f1f1;
    line-height: 1.7;
    white-space: pre-line;
}

/* 조회수·업로드 날짜 + 설명을 하나의 박스로 묶음 (유튜브 스타일) */
.watch-description-box {
    margin-top: 14px;
    background: #272727;
    border-radius: 12px;
    padding: 12px 16px;
    color: #f1f1f1;
    font-size: 14px;
    line-height: 1.6;
}

.watch-description-meta {
    display: block;
    font-weight: 600;
    color: #f1f1f1;
    margin-bottom: 8px;
}

.watch-description-text {
    white-space: pre-line;
    word-break: break-word;
}

.watch-description-box.is-collapsed .watch-description-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-description-toggle {
    margin-top: 8px;
    background: none;
    border: none;
    padding: 0;
    color: #f1f1f1;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.watch-description-toggle:hover {
    text-decoration: underline;
}

.watch-recommend-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* recommend card */
.recommend-card {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.18s ease;
    min-width: 0;
}

.recommend-card:hover {
    background: #1a1a1a;
}

.recommend-thumb {
    position: relative;
    /* 사이드바 폭(=모니터 해상도)에 비례하는 유동 크기, 200~360px 범위로 제한 */
    flex-shrink: 0;
    width: clamp(200px, 53%, 360px);
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
}

.recommend-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.22s ease;
}

.recommend-card:hover .recommend-thumb img {
    transform: scale(1.04);
}

.recommend-duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    font-weight: 500;
}

.recommend-info {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}

.recommend-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #f1f1f1;
    transition: color 0.18s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommend-card:hover .recommend-title {
    color: #ffffff;
}

.recommend-meta {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #aaaaaa;
}

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

.comments-header h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.comment-form-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4e45, #ff8a00);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

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

.comment-input {
    width: 100%;
    height: 42px;
    border: none;
    border-bottom: 1px solid #303030;
    background: transparent;
    color: #fff;
    outline: none;
    padding: 0 0 8px;
}

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

.comment-btn {
    min-width: 72px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #303030;
    background: #272727;
    color: #fff;
    cursor: pointer;
}

.comment-btn.submit {
    background: #fff;
    color: #111;
    border-color: #fff;
    font-weight: 700;
}

.comment-btn.submit:disabled {
    opacity: 0.45;
    cursor: default;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
}

.replies-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reply-item {
    padding-left: 4px;
    border-left: 2px solid #333;
}

.reply-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
}

.comment-reply-btn {
    font-size: 13px;
    color: #aaa;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.comment-reply-btn:hover {
    color: #fff;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #272727;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-content {
    min-width: 0;
}

.comment-author-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.comment-author {
    font-size: 13px;
    font-weight: 700;
}

.comment-time {
    font-size: 12px;
    color: #aaaaaa;
}

.comment-text,
.comment-empty {
    margin: 0;
    color: #f1f1f1;
    line-height: 1.6;
    word-break: break-word;
}

/* upload */
.upload-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 40px;
}

.upload-wizard-card {
    background: #181818;
    border: 1px solid #272727;
    border-radius: 24px;
    padding: 24px;
}

.upload-wizard-title {
    margin: 0 0 18px;
    font-size: 28px;
    line-height: 1.25;
}

.upload-step-indicators {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.upload-step-chip {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #303030;
    background: #202020;
    color: #bdbdbd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.upload-step-chip.is-active {
    background: #fff;
    color: #111;
    border-color: #fff;
    font-weight: 700;
}

.upload-step-chip.is-complete {
    background: #2f2f2f;
    color: #fff;
}

.upload-step-panel {
    display: none;
}

.upload-step-panel.is-active {
    display: block;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-field label {
    font-size: 14px;
    font-weight: 500;
}

.upload-input,
.upload-select,
.upload-textarea {
    width: 100%;
    border: 1px solid #303030;
    background: #121212;
    color: #fff;
    border-radius: 14px;
    outline: none;
}

.upload-input,
.upload-select {
    height: 46px;
    padding: 0 14px;
}

.upload-textarea {
    min-height: 140px;
    resize: vertical;
    padding: 14px;
    line-height: 1.6;
}

.upload-file-box {
    border: 1px dashed #3a3a3a;
    border-radius: 16px;
    padding: 20px;
    background: #131313;
}

.upload-file-name {
    margin-top: 10px;
    color: #aaaaaa;
    font-size: 13px;
}

.upload-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.upload-radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #303030;
    background: #202020;
    font-size: 13px;
}

.upload-preview-card,
.upload-summary-card {
    background: #121212;
    border: 1px solid #2c2c2c;
    border-radius: 18px;
    padding: 16px;
}

.upload-preview-title,
.upload-summary-title {
    margin: 0 0 14px;
    font-size: 15px;
}

.upload-thumb-preview,
.upload-summary-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    text-align: center;
}

.upload-thumb-preview img,
.upload-summary-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.upload-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #232323;
}

.upload-summary-item:last-child {
    border-bottom: none;
}

.upload-summary-label {
    color: #aaaaaa;
    font-size: 13px;
}

.upload-summary-value {
    text-align: right;
    font-size: 14px;
    word-break: break-word;
}

.upload-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.upload-link-btn,
.upload-cancel,
.upload-next,
.upload-submit {
    min-width: 110px;
    height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid #303030;
    background: #202020;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

.upload-submit,
.upload-next {
    background: #fff;
    color: #111;
    border-color: #fff;
    font-weight: 700;
}

/* saved / liked helper */
.saved-card,
.liked-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.saved-card-actions,
.liked-card-actions {
    display: flex;
    justify-content: flex-end;
}

.saved-remove-btn,
.liked-remove-btn {
    border: 1px solid #303030;
    background: #181818;
    color: #fff;
    border-radius: 999px;
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    cursor: pointer;
}

.saved-remove-btn:hover,
.liked-remove-btn:hover {
    background: #272727;
}

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

    .watch-layout {
        flex-direction: column;
    }

    .watch-main-column {
        max-width: 100%;
    }

    .watch-side-column {
        width: 100%;
    }
}

@media (max-width: 980px) {
    .upload-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .topbar {
        padding: 0 12px;
        gap: 10px;
    }

    .topbar-left {
        min-width: auto;
    }

    .topbar-right {
        min-width: auto;
        gap: 8px;
    }

    .logo-text {
        display: none;
    }

    .main,
    .watch-page,
    .upload-page {
        padding-left: 16px;
        padding-right: 16px;
    }

    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .watch-title {
        font-size: 20px;
    }

    .watch-meta-row {
        align-items: stretch;
    }

    .watch-side-column {
        position: static !important;
    }
}

@media (max-width: 768px) {
    .search-form {
        max-width: none;
    }

    .search-btn {
        width: 56px;
    }

    .recommend-thumb {
        width: 150px;
        min-width: 150px;
    }

    .watch-channel-box {
        width: 100%;
    }

    .watch-actions {
        width: 100%;
    }

    .watch-action-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    .comment-form {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 0 10px;
        gap: 8px;
    }

    .topbar-left {
        gap: 6px;
    }

    .topbar-center {
        min-width: 0;
    }

    .search-form input {
        font-size: 13px;
        padding: 0 12px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    .profile {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .main,
    .watch-page,
    .upload-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .meta {
        gap: 10px;
    }

    .text h3 {
        font-size: 15px;
    }

    .channel-name,
    .video-info {
        font-size: 13px;
    }

    .watch-title {
        font-size: 18px;
        margin-top: 14px;
    }

    .watch-channel-avatar {
        width: 38px;
        height: 38px;
    }

    .watch-channel-text strong {
        font-size: 14px;
    }

    .watch-channel-text span {
        font-size: 12px;
    }

    .watch-actions {
        gap: 6px;
    }

    .watch-action-btn {
        height: 36px;
        font-size: 13px;
        padding: 0 10px;
    }

    .recommend-card {
        padding: 6px;
        gap: 8px;
    }

    .recommend-thumb {
        width: 132px;
        min-width: 132px;
        border-radius: 10px;
    }

    .recommend-title {
        font-size: 13px;
    }

    .recommend-meta {
        font-size: 11px;
    }

    .comment-form {
        gap: 10px;
    }

    .comment-form-avatar,
    .comment-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .comment-form-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .comment-btn {
        min-width: 64px;
        height: 34px;
        font-size: 13px;
    }

    .upload-wizard-card {
        padding: 18px;
    }

    .upload-wizard-title {
        font-size: 24px;
    }

    .upload-step-indicators {
        gap: 8px;
    }

    .upload-step-chip {
        min-height: 36px;
        padding: 0 12px;
        font-size: 12px;
    }

    .upload-input,
    .upload-select {
        height: 44px;
        font-size: 14px;
    }

    .upload-textarea {
        min-height: 120px;
        font-size: 14px;
    }

    .upload-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .upload-link-btn,
    .upload-cancel,
    .upload-next,
    .upload-submit {
        width: 100%;
    }

    .saved-card-actions,
    .liked-card-actions {
        justify-content: stretch;
    }

    .saved-remove-btn,
    .liked-remove-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .topbar {
        height: 52px;
    }

    .logo-badge {
        width: 30px;
        height: 30px;
        border-radius: 50%;
    }

    .search-form {
        height: 38px;
    }

    .search-form input {
        height: 38px;
    }

    .search-btn {
        height: 38px;
        width: 50px;
    }

    .watch-page,
    .main,
    .upload-page {
        padding-top: 14px;
        padding-bottom: 24px;
    }

    .recommend-thumb {
        width: 120px;
        min-width: 120px;
    }

    .watch-description,
    .watch-description-box {
        padding: 12px 13px;
        font-size: 14px;
    }
}
/* =========================================================
   메인/공통 상단 헤더 고정 보정
   - 햄버거 버튼이 스크롤 후에야 보이는 문제 수정
   - upload.html은 기존 업로드 클린 레이아웃 유지
========================================================= */

body:not(.upload-clean-layout) {
    padding-top: 56px;
}

body:not(.upload-clean-layout) .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 5000;
    background: #0f0f0f;
}

body:not(.upload-clean-layout) .sidebar,
body:not(.upload-clean-layout) #sidebar {
    top: 56px;
    height: calc(100vh - 56px);
}

body:not(.upload-clean-layout) .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* ── 이어보기 바 ────────────────────────────────────────── */
.resume-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e1e1e;
    border-top: 1px solid #303030;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.resume-bar.show {
    transform: translateY(0);
}

.resume-bar-thumb-wrap {
    position: relative;
    width: 80px;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}

.resume-bar-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.resume-bar-thumb-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #f00;
    border-radius: 0 2px 2px 0;
}

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

.resume-bar-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f1f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.resume-bar-meta {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resume-bar-track {
    margin-top: 5px;
    height: 3px;
    background: #444;
    border-radius: 2px;
    overflow: hidden;
}

.resume-bar-fill {
    height: 100%;
    background: #f00;
    border-radius: 2px;
}

.resume-bar-play {
    background: #f1f1f1;
    color: #0f0f0f;
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.resume-bar-play:hover {
    background: #fff;
}

.resume-bar-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.resume-bar-close:hover {
    background: #333;
    color: #fff;
}

@media (min-width: 640px) {
    .resume-bar {
        left: auto;
        right: 24px;
        bottom: 24px;
        width: 380px;
        border-radius: 14px;
        border: 1px solid #303030;
        border-top: 1px solid #303030;
        transform: translateY(calc(100% + 24px));
    }
    .resume-bar.show {
        transform: translateY(0);
    }
}
/* ─────────────────────────────────────────────────────── */

/* ── 통합 설정 메뉴 (속도 + 화질) ─────────────────────── */
.cp-settings-wrap { position: relative; }

.cp-settings-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: rgba(20,20,20,0.97);
    border: 1px solid #333;
    border-radius: 10px;
    min-width: 200px;
    overflow: hidden;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.97);
    transform-origin: bottom right;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.cp-settings-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.cp-set-panel { padding: 6px 0; }

.cp-set-panel.is-entering {
    animation: cp-panel-in 0.15s ease;
}

@keyframes cp-panel-in {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes cp-panel-back {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

.cp-set-panel.is-entering-back {
    animation: cp-panel-back 0.15s ease;
}

.cp-set-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    gap: 16px;
}

.cp-set-item::after {
    content: '›';
    color: #aaa;
    font-size: 16px;
}

.cp-set-item { transition: background 0.12s; }
.cp-set-item:hover { background: rgba(255,255,255,0.08); }

.cp-set-val {
    color: #aaa;
    font-size: 12px;
    flex-shrink: 0;
}

.cp-set-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
}

.cp-set-back::before { content: '‹'; font-size: 16px; color: #aaa; }
.cp-set-back { transition: background 0.12s; }
.cp-set-back:hover { background: rgba(255,255,255,0.06); }

.cp-set-option {
    padding: 9px 16px 9px 36px;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    position: relative;
}

.cp-set-option { transition: background 0.12s, color 0.12s; }
.cp-set-option:hover { background: rgba(255,255,255,0.08); color: #fff; }

.cp-set-option.active {
    color: #fff;
    font-weight: 600;
}

.cp-set-option.active::before {
    content: '✓';
    position: absolute;
    left: 14px;
    color: #fff;
}

/* =========================================================
   Studio Page (studio.html)
========================================================= */

.studio-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

.studio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.studio-header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

.studio-upload-btn {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.18s;
}

.studio-upload-btn:hover {
    background: #e8e8e8;
}

.studio-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.studio-card {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    gap: 16px;
    align-items: start;
    background: #181818;
    border: 1px solid #272727;
    border-radius: 16px;
    padding: 14px;
    transition: background 0.18s, border-color 0.18s;
}

.studio-card:hover {
    background: #202020;
    border-color: #333;
}

.studio-card-thumb {
    position: relative;
    display: block;
    width: 160px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
    flex-shrink: 0;
}

.studio-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.studio-card-duration {
    position: absolute;
    right: 7px;
    bottom: 7px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 5px;
}

.studio-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.studio-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.studio-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}

.studio-card-title a {
    color: #f1f1f1;
    text-decoration: none;
}

.studio-card-title a:hover {
    color: #fff;
    text-decoration: underline;
}

.studio-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.studio-badge--public {
    background: #1a3a1a;
    color: #6fcf6f;
    border: 1px solid #2a5a2a;
}

.studio-badge--private {
    background: #2a2a2a;
    color: #aaa;
    border: 1px solid #3a3a3a;
}

.studio-card-meta {
    margin: 0;
    font-size: 13px;
    color: #9aa0a6;
}

.studio-conv-status {
    margin-top: 4px;
    font-size: 13px;
}

.studio-conv-done {
    color: #6fcf6f;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.studio-conv-icon {
    font-size: 14px;
}

.studio-conv-pending {
    color: #f0c040;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.studio-conv-label {
    font-size: 13px;
}

.studio-progress-bar-wrap {
    width: 100%;
    max-width: 240px;
    height: 6px;
    background: #333;
    border-radius: 999px;
    overflow: hidden;
}

.studio-progress-bar {
    height: 100%;
    background: #f0c040;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.studio-res-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.studio-res-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    background: #252525;
    border: 1px solid #333;
    color: #ccc;
    font-size: 11px;
    font-weight: 600;
}

.studio-card-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex-shrink: 0;
}

.studio-card-actions .studio-action-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #303030;
    background: #202020;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.studio-card-actions .studio-action-btn:hover {
    background: #2a2a2a;
    border-color: #3b3b3b;
}

.studio-card-actions .studio-action-btn--delete {
    background: #2a1616;
    border-color: #4c2424;
    color: #ffb4b4;
}

.studio-card-actions .studio-action-btn--delete:hover {
    background: #3a1c1c;
    border-color: #6a2e2e;
}

.studio-empty {
    text-align: center;
    padding: 60px 24px;
    border: 1px solid #272727;
    border-radius: 20px;
    background: linear-gradient(180deg, #181818, #151515);
}

.studio-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #202020;
    border: 1px solid #2e2e2e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.studio-empty-icon svg {
    width: 32px;
    height: 32px;
    fill: #9aa0a6;
}

.studio-empty-title {
    margin: 0 0 10px;
    font-size: 20px;
    color: #fff;
}

.studio-empty-text {
    margin: 0 0 22px;
    color: #9aa0a6;
    font-size: 14px;
    line-height: 1.7;
}

.studio-loading,
.studio-error {
    text-align: center;
    padding: 40px 0;
    color: #9aa0a6;
    font-size: 15px;
}

.studio-error {
    color: #ff6b6b;
}

@media (max-width: 700px) {
    .studio-wrap {
        padding: 20px 14px 40px;
    }

    .studio-card {
        grid-template-columns: 120px 1fr;
        grid-template-rows: auto auto;
    }

    .studio-card-thumb {
        width: 120px;
    }

    .studio-card-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .studio-card {
        grid-template-columns: 1fr;
    }

    .studio-card-thumb {
        width: 100%;
    }

    .studio-card-actions {
        grid-column: 1;
    }
}
/* ─────────────────────────────────────────────────────── */

/* ── Sidebar label overflow fix ─────────────────────────────── */
.sidebar .sidebar-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.is-collapsed .sidebar-sub-title {
    display: none;
}

/* 구독 채널 이름 라벨 (확장프로그램 간섭 방지용 별도 클래스) */
.sub-channel-label {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.sidebar.is-collapsed .sub-channel-label {
    display: none;
}

.sidebar.is-collapsed #subscriptionSidebarSection .sidebar-link {
    min-height: 64px;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    gap: 6px;
    border-radius: 12px;
}

/* ── Theme transition ────────────────────────────────────────── */
body,
.topbar,
.search-form,
.search-btn,
.sidebar,
.category-bar,
.notif-dropdown,
.ch-card,
.upload-wizard-card,
.studio-card,
.resume-bar {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ── Channel Tabs ────────────────────────────────────────────── */
.ch-tabs-bar {
    display: flex;
    border-bottom: 1px solid #272727;
    margin-bottom: 0;
    gap: 0;
    position: sticky;
    top: 56px;
    background: #0f0f0f;
    z-index: 10;
}

.ch-tab-btn {
    position: relative;
    height: 48px;
    padding: 0 20px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
    white-space: nowrap;
}

.ch-tab-btn:hover { color: #f1f1f1; }

.ch-tab-btn.is-active {
    color: #f1f1f1;
}

.ch-tab-btn.is-active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #f1f1f1;
    border-radius: 2px 2px 0 0;
}

.ch-tab-panel { display: none; }
.ch-tab-panel.is-active { display: block; }

/* Playlist grid on channel page */
.ch-pl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px 0;
}

.ch-pl-card {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #181818;
    transition: background 0.15s;
}

.ch-pl-card:hover { background: #222; }

.ch-pl-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #272727;
    overflow: hidden;
}

.ch-pl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ch-pl-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #555;
}

.ch-pl-count {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.ch-pl-info {
    padding: 10px 12px;
}

.ch-pl-name {
    font-size: 14px;
    font-weight: 500;
    color: #f1f1f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-pl-meta {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

/* About tab */
.ch-about-section {
    padding: 24px 0;
    max-width: 680px;
}

.ch-about-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #272727;
}

.ch-about-row:last-child { border-bottom: none; }

.ch-about-label {
    font-size: 14px;
    color: #aaa;
    min-width: 80px;
    flex-shrink: 0;
}

.ch-about-value {
    font-size: 14px;
    color: #f1f1f1;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.ch-tab-empty {
    padding: 60px 0;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

/* Light mode overrides */
html[data-theme="light"] .ch-tabs-bar {
    background: #fff;
    border-bottom-color: #e0e0e0;
}
html[data-theme="light"] .ch-tab-btn { color: #606060; }
html[data-theme="light"] .ch-tab-btn:hover { color: #0f0f0f; }
html[data-theme="light"] .ch-tab-btn.is-active { color: #0f0f0f; }
html[data-theme="light"] .ch-tab-btn.is-active::after { background: #0f0f0f; }
html[data-theme="light"] .ch-pl-card { background: #f2f2f2; }
html[data-theme="light"] .ch-pl-card:hover { background: #e5e5e5; }
html[data-theme="light"] .ch-pl-thumb { background: #e0e0e0; }
html[data-theme="light"] .ch-pl-name { color: #0f0f0f; }
html[data-theme="light"] .ch-pl-meta { color: #606060; }
html[data-theme="light"] .ch-about-row { border-bottom-color: #e0e0e0; }
html[data-theme="light"] .ch-about-label { color: #606060; }
html[data-theme="light"] .ch-about-value { color: #0f0f0f; }

/* ── Light Mode ──────────────────────────────────────────────── */
html[data-theme="light"],
html[data-theme="light"] body {
    background: #f9f9f9;
    color: #0f0f0f;
}

/* Topbar */
html[data-theme="light"] .topbar,
html[data-theme="light"] body:not(.upload-clean-layout) .topbar {
    background: #ffffff;
    border-bottom-color: #e5e5e5;
}

html[data-theme="light"] .icon-btn,
html[data-theme="light"] .menu-btn,
html[data-theme="light"] .notif-btn {
    color: #0f0f0f;
}

html[data-theme="light"] .icon-btn:hover,
html[data-theme="light"] .menu-btn:hover,
html[data-theme="light"] .notif-btn:hover {
    background: #e5e5e5;
}

/* Search */
html[data-theme="light"] .search-form {
    background: #ffffff;
    border-color: #cccccc;
}

html[data-theme="light"] .search-form input {
    color: #0f0f0f;
}

html[data-theme="light"] .search-form input::placeholder {
    color: #909090;
}

html[data-theme="light"] .search-btn {
    background: #f2f2f2;
    border-left-color: #cccccc;
    color: #0f0f0f;
}

html[data-theme="light"] .search-btn:hover {
    background: #e8e8e8;
}

/* Sidebar */
html[data-theme="light"] .sidebar {
    background: #f9f9f9 !important;
    border-right-color: #e5e5e5 !important;
}

html[data-theme="light"] .sidebar-section {
    border-bottom-color: #e5e5e5 !important;
}

html[data-theme="light"] .sidebar-link {
    color: #0f0f0f !important;
}

html[data-theme="light"] .sidebar-link:hover {
    background: #e8e8e8 !important;
}

html[data-theme="light"] .sidebar-link.is-active {
    background: #e5e5e5 !important;
}

html[data-theme="light"] .sidebar-sub-title {
    color: #909090 !important;
}

html[data-theme="light"] .mobile-sidebar-backdrop {
    background: rgba(0, 0, 0, 0.2);
}

/* Category bar */
html[data-theme="light"] .category-bar {
    background: #f9f9f9;
    border-bottom-color: #e5e5e5;
}

html[data-theme="light"] .category-chip {
    background: #e5e5e5;
    color: #0f0f0f;
}

html[data-theme="light"] .category-chip:hover {
    background: #d5d5d5;
}

html[data-theme="light"] .category-chip.is-active {
    background: #0f0f0f;
    color: #f9f9f9;
}

/* Video cards */
html[data-theme="light"] .text h3 {
    color: #0f0f0f;
}

html[data-theme="light"] .channel-name,
html[data-theme="light"] .video-info {
    color: #606060;
}

html[data-theme="light"] .thumbnail-wrap {
    background: #e5e5e5;
}

/* Auth buttons */
html[data-theme="light"] .auth-topbar-btn {
    border-color: #cccccc;
    background: #f2f2f2;
    color: #0f0f0f;
}

html[data-theme="light"] .auth-topbar-btn.primary {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

html[data-theme="light"] .auth-topbar-btn.logout {
    background: #fff0f0;
    border-color: #ffaaaa;
    color: #cc3333;
}

/* Notifications */
html[data-theme="light"] .notif-dropdown {
    background: #ffffff;
    border-color: #e5e5e5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .notif-header {
    color: #0f0f0f;
    border-bottom-color: #e5e5e5;
}

html[data-theme="light"] .notif-item {
    border-bottom-color: #f0f0f0;
}

html[data-theme="light"] .notif-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .notif-item.unread {
    background: rgba(168, 85, 247, 0.06);
}

html[data-theme="light"] .notif-msg {
    color: #0f0f0f;
}

html[data-theme="light"] .notif-time {
    color: #909090;
}

html[data-theme="light"] .notif-type-icon {
    background: #f2f2f2;
    border-color: #e5e5e5;
}

html[data-theme="light"] .notif-empty {
    color: #909090;
}

html[data-theme="light"] .notif-comment-nav {
    border-bottom-color: #e5e5e5;
}

html[data-theme="light"] .notif-comment-item {
    border-bottom-color: #f0f0f0;
}

html[data-theme="light"] .notif-comment-text {
    color: #0f0f0f;
}

html[data-theme="light"] .notif-comment-time {
    color: #909090;
}

/* Watch page */
html[data-theme="light"] .watch-description {
    background: #f2f2f2;
    color: #0f0f0f;
}

html[data-theme="light"] .watch-action-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .watch-action-btn:hover {
    background: #e8e8e8;
}

html[data-theme="light"] .watch-action-btn.active {
    background: #e0e0e0;
    border-color: #c0c0c0;
}

html[data-theme="light"] .watch-action-btn.primary {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

html[data-theme="light"] .watch-channel-text span {
    color: #606060;
}

html[data-theme="light"] .recommend-card:hover {
    background: #f0f0f0;
}

html[data-theme="light"] .recommend-title {
    color: #0f0f0f;
}

html[data-theme="light"] .recommend-meta {
    color: #606060;
}

html[data-theme="light"] .recommend-thumb {
    background: #e5e5e5;
}

/* Comments */
html[data-theme="light"] .comment-input {
    color: #0f0f0f;
    border-bottom-color: #d0d0d0;
}

html[data-theme="light"] .comment-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .comment-btn.submit {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

html[data-theme="light"] .comment-text,
html[data-theme="light"] .comment-empty {
    color: #0f0f0f;
}

html[data-theme="light"] .comment-time {
    color: #909090;
}

html[data-theme="light"] .reply-item {
    border-left-color: #e0e0e0;
}

html[data-theme="light"] .comment-like-btn {
    color: #606060;
}

html[data-theme="light"] .comment-like-btn:hover {
    color: #0f0f0f;
}

html[data-theme="light"] .comment-reply-btn {
    color: #606060;
}

html[data-theme="light"] .comment-reply-btn:hover {
    color: #0f0f0f;
}

/* Channel search results */
html[data-theme="light"] .channel-results-title {
    color: #0f0f0f;
}

html[data-theme="light"] .ch-card {
    background: #f2f2f2;
    border-color: #e0e0e0;
}

html[data-theme="light"] .ch-card:hover {
    background: #e8e8e8;
}

html[data-theme="light"] .ch-card-name {
    color: #0f0f0f;
}

html[data-theme="light"] .ch-card-meta {
    color: #606060;
}

html[data-theme="light"] .ch-card-sub-btn {
    border-color: #c0c0c0;
    color: #0f0f0f;
}

html[data-theme="light"] .ch-card-sub-btn:hover {
    background: #e5e5e5;
}

html[data-theme="light"] .ch-card-sub-btn.is-subscribed {
    background: #e8e8e8;
    border-color: #cccccc;
    color: #606060;
}

/* Upload page */
html[data-theme="light"] .upload-wizard-card {
    background: #ffffff;
    border-color: #e5e5e5;
}

html[data-theme="light"] .upload-input,
html[data-theme="light"] .upload-select,
html[data-theme="light"] .upload-textarea {
    background: #f5f5f5;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .upload-file-box {
    background: #f9f9f9;
    border-color: #cccccc;
}

html[data-theme="light"] .upload-file-name {
    color: #606060;
}

html[data-theme="light"] .upload-step-chip {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #606060;
}

html[data-theme="light"] .upload-step-chip.is-active {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

html[data-theme="light"] .upload-step-chip.is-complete {
    background: #e5e5e5;
    color: #0f0f0f;
    border-color: #d0d0d0;
}

html[data-theme="light"] .upload-radio-option {
    background: #f2f2f2;
    border-color: #d0d0d0;
}

html[data-theme="light"] .upload-preview-card,
html[data-theme="light"] .upload-summary-card {
    background: #f9f9f9;
    border-color: #e5e5e5;
}

html[data-theme="light"] .upload-thumb-preview,
html[data-theme="light"] .upload-summary-thumb {
    background: #e5e5e5;
    color: #909090;
}

html[data-theme="light"] .upload-summary-item {
    border-bottom-color: #e5e5e5;
}

html[data-theme="light"] .upload-summary-label {
    color: #606060;
}

html[data-theme="light"] .upload-link-btn,
html[data-theme="light"] .upload-cancel {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .upload-submit,
html[data-theme="light"] .upload-next {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

/* Studio page */
html[data-theme="light"] .studio-card {
    background: #ffffff;
    border-color: #e5e5e5;
}

html[data-theme="light"] .studio-card:hover {
    background: #f9f9f9;
    border-color: #d0d0d0;
}

html[data-theme="light"] .studio-card-title a {
    color: #0f0f0f;
}

html[data-theme="light"] .studio-card-meta {
    color: #606060;
}

html[data-theme="light"] .studio-card-thumb {
    background: #e5e5e5;
}

html[data-theme="light"] .studio-res-badge {
    background: #f0f0f0;
    border-color: #d0d0d0;
    color: #606060;
}

html[data-theme="light"] .studio-card-actions .studio-action-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .studio-card-actions .studio-action-btn:hover {
    background: #e5e5e5;
    border-color: #c0c0c0;
}

html[data-theme="light"] .studio-empty {
    border-color: #e5e5e5;
    background: linear-gradient(180deg, #f9f9f9, #f2f2f2);
}

html[data-theme="light"] .studio-empty-icon {
    background: #f2f2f2;
    border-color: #e0e0e0;
}

html[data-theme="light"] .studio-empty-icon svg {
    fill: #909090;
}

html[data-theme="light"] .studio-empty-title {
    color: #0f0f0f;
}

html[data-theme="light"] .studio-empty-text,
html[data-theme="light"] .studio-loading {
    color: #606060;
}

/* Saved/Liked */
html[data-theme="light"] .saved-remove-btn,
html[data-theme="light"] .liked-remove-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .saved-remove-btn:hover,
html[data-theme="light"] .liked-remove-btn:hover {
    background: #e5e5e5;
}

/* Subscription feed */
html[data-theme="light"] .sub-feed-title {
    color: #0f0f0f;
}

html[data-theme="light"] .sub-feed-empty {
    color: #606060;
}

html[data-theme="light"] .sub-feed-empty h3 {
    color: #0f0f0f;
}

/* Scroll loader */
html[data-theme="light"] .scroll-loader-dot {
    background: #c0c0c0;
}

/* 이어보기 바 */
html[data-theme="light"] .resume-bar {
    background: #f8f8f8;
    border-color: #d0d0d0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .resume-bar-title {
    color: #0f0f0f;
}

html[data-theme="light"] .resume-bar-meta {
    color: #606060;
}

html[data-theme="light"] .resume-bar-track {
    background: #d0d0d0;
}

html[data-theme="light"] .resume-bar-play {
    background: #0f0f0f;
    color: #fff;
}

html[data-theme="light"] .resume-bar-play:hover {
    background: #272727;
}

html[data-theme="light"] .resume-bar-close {
    color: #606060;
}

html[data-theme="light"] .resume-bar-close:hover {
    background: #e5e5e5;
    color: #0f0f0f;
}

/* Home empty state */
html[data-theme="light"] .home-empty-state {
    border-color: #e5e5e5;
    background: linear-gradient(180deg, #f9f9f9, #f2f2f2);
}

html[data-theme="light"] .home-empty-icon {
    background: #f2f2f2;
    border-color: #e0e0e0;
}

html[data-theme="light"] .home-empty-icon svg {
    fill: #909090;
}

html[data-theme="light"] .home-empty-title {
    color: #0f0f0f;
}

html[data-theme="light"] .home-empty-text {
    color: #606060;
}

html[data-theme="light"] .home-empty-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .home-empty-btn.primary {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

/* Auth pages (login / signup / forgot-password) */
html[data-theme="light"] .auth-card {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

html[data-theme="light"] .auth-title {
    color: #0f0f0f !important;
}

html[data-theme="light"] .auth-subtitle {
    color: #606060 !important;
}

html[data-theme="light"] .auth-field label {
    color: #0f0f0f !important;
}

html[data-theme="light"] .auth-input {
    background: #f5f5f5 !important;
    border-color: #d0d0d0 !important;
    color: #0f0f0f !important;
}

html[data-theme="light"] .auth-submit {
    background: #0f0f0f !important;
    border-color: #0f0f0f !important;
    color: #ffffff !important;
}

html[data-theme="light"] .auth-footer {
    color: #606060 !important;
}

html[data-theme="light"] .auth-footer a {
    color: #0f0f0f !important;
}

/* ── Profile page ────────────────────────────────────────────── */
html[data-theme="light"] .profile-card {
    background: #ffffff;
    border-color: #e5e5e5;
}

html[data-theme="light"] .profile-title,
html[data-theme="light"] .profile-card h2 {
    color: #0f0f0f;
}

html[data-theme="light"] .profile-subtitle {
    color: #606060;
}

html[data-theme="light"] .profile-field label {
    color: #0f0f0f;
}

html[data-theme="light"] .profile-input {
    background: #f5f5f5;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .profile-input[readonly] {
    background: #ebebeb;
    color: #909090;
}

html[data-theme="light"] .profile-help {
    color: #909090;
}

html[data-theme="light"] .profile-btn,
html[data-theme="light"] .profile-link-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .profile-btn.primary {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

/* ── Edit page ───────────────────────────────────────────────── */
html[data-theme="light"] .edit-card {
    background: #ffffff;
    border-color: #e5e5e5;
}

html[data-theme="light"] .edit-header p {
    color: #606060;
}

html[data-theme="light"] .edit-field label {
    color: #0f0f0f;
}

html[data-theme="light"] .edit-input,
html[data-theme="light"] .edit-select,
html[data-theme="light"] .edit-textarea {
    background: #f5f5f5;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .edit-radio-option {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .edit-preview {
    background: #f9f9f9;
    border-color: #e5e5e5;
}

html[data-theme="light"] .edit-preview-title {
    color: #0f0f0f;
}

html[data-theme="light"] .edit-preview-thumb {
    background: #e5e5e5;
}

html[data-theme="light"] .edit-preview-meta p {
    color: #606060;
}

html[data-theme="light"] .edit-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .edit-btn.primary {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

/* ── History page ────────────────────────────────────────────── */
html[data-theme="light"] .history-kicker {
    color: #909090;
}

html[data-theme="light"] .history-count {
    color: #606060;
}

html[data-theme="light"] .history-empty-state {
    color: #606060;
}

/* ── Liked / Saved pages ─────────────────────────────────────── */
html[data-theme="light"] .liked-kicker,
html[data-theme="light"] .saved-kicker {
    color: #909090;
}

html[data-theme="light"] .liked-count,
html[data-theme="light"] .saved-count {
    color: #606060;
}

html[data-theme="light"] .liked-search-form,
html[data-theme="light"] .saved-search-form {
    background: #ffffff;
    border-color: #d0d0d0;
}

html[data-theme="light"] .liked-search-input,
html[data-theme="light"] .saved-search-input {
    color: #0f0f0f;
    background: transparent;
}

html[data-theme="light"] .liked-search-input::placeholder,
html[data-theme="light"] .saved-search-input::placeholder {
    color: #909090;
}

html[data-theme="light"] .liked-search-btn,
html[data-theme="light"] .saved-search-btn {
    background: #f2f2f2;
    border-left-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .liked-search-btn:hover,
html[data-theme="light"] .saved-search-btn:hover {
    background: #e5e5e5;
}

html[data-theme="light"] .liked-empty-state,
html[data-theme="light"] .saved-empty-state {
    color: #606060;
}

/* ── Subscriptions page ──────────────────────────────────────── */
html[data-theme="light"] .sub-channel-strip {
    border-bottom-color: #e5e5e5;
}

html[data-theme="light"] .sub-channel-item {
    color: #0f0f0f;
}

html[data-theme="light"] .sub-feed-empty-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

/* ── User channel page ───────────────────────────────────────── */
html[data-theme="light"] .user-banner,
html[data-theme="light"] .user-banner-placeholder {
    background: linear-gradient(135deg, #d4d8e8, #c8d4e8);
}

html[data-theme="light"] .user-profile-row {
    border-bottom-color: #e5e5e5;
}

html[data-theme="light"] .user-avatar {
    border-color: #f9f9f9;
}

html[data-theme="light"] .user-channel-name {
    color: #0f0f0f;
}

html[data-theme="light"] .user-meta {
    color: #606060;
}

html[data-theme="light"] .user-bio {
    color: #0f0f0f;
}

html[data-theme="light"] .user-subscribe-btn.subscribed {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #606060;
}

html[data-theme="light"] .user-videos-title {
    color: #0f0f0f;
}

/* ── Watch page (recommend panel) ────────────────────────────── */
html[data-theme="light"] .watch-recommend-title {
    color: #0f0f0f;
}

html[data-theme="light"] .watch-recommend-sub {
    color: #606060;
}

/* ── Channel management page ─────────────────────────────────── */
html[data-theme="light"] .channel-banner {
    background: linear-gradient(135deg, #d4d8e8, #c8d4e8);
}

html[data-theme="light"] .channel-bio,
html[data-theme="light"] .channel-hero-text p {
    color: #606060;
}

html[data-theme="light"] .channel-hero-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .channel-hero-btn.primary {
    background: #0f0f0f;
    color: #ffffff;
    border-color: #0f0f0f;
}

html[data-theme="light"] .studio-stat-card {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

html[data-theme="light"] .studio-stat-label {
    color: #606060 !important;
}

html[data-theme="light"] .studio-stat-value {
    color: #0f0f0f !important;
}

html[data-theme="light"] .studio-search {
    background: #ffffff !important;
    border-color: #d0d0d0 !important;
    color: #0f0f0f !important;
}

html[data-theme="light"] .studio-search::placeholder {
    color: #909090 !important;
}

html[data-theme="light"] .studio-filter-btn {
    background: #f2f2f2 !important;
    border-color: #d0d0d0 !important;
    color: #0f0f0f !important;
}

html[data-theme="light"] .studio-filter-btn:hover {
    background: #e5e5e5 !important;
}

html[data-theme="light"] .studio-filter-btn.is-active {
    background: #0f0f0f !important;
    color: #ffffff !important;
    border-color: #0f0f0f !important;
}

html[data-theme="light"] .studio-sort {
    background: #f2f2f2 !important;
    border-color: #d0d0d0 !important;
    color: #0f0f0f !important;
}

html[data-theme="light"] .studio-table {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

html[data-theme="light"] .studio-head {
    background: #f5f5f5 !important;
    color: #606060 !important;
    border-bottom-color: #e5e5e5 !important;
}

html[data-theme="light"] .studio-row {
    border-top-color: #f0f0f0 !important;
}

html[data-theme="light"] .studio-row:hover {
    background: #f9f9f9 !important;
}

html[data-theme="light"] .studio-video-title {
    color: #0f0f0f !important;
}

html[data-theme="light"] .studio-row:hover .studio-video-title {
    color: #0f0f0f !important;
}

html[data-theme="light"] .studio-video-meta,
html[data-theme="light"] .studio-video-desc {
    color: #606060 !important;
}

html[data-theme="light"] .studio-cell-text,
html[data-theme="light"] .studio-number {
    color: #0f0f0f !important;
}

html[data-theme="light"] .studio-status-badge {
    background: #f0f0f0 !important;
    border-color: #d0d0d0 !important;
    color: #606060 !important;
}

html[data-theme="light"] .studio-action-btn {
    background: #f2f2f2 !important;
    border-color: #d0d0d0 !important;
    color: #0f0f0f !important;
}

html[data-theme="light"] .studio-action-btn:hover {
    background: #e5e5e5 !important;
}

html[data-theme="light"] .studio-action-btn.delete {
    background: #fff0f0 !important;
    border-color: #ffcccc !important;
    color: #cc3333 !important;
}

html[data-theme="light"] .studio-thumb {
    background: #e5e5e5 !important;
}

html[data-theme="light"] .channel-hero-btn {
    background: #f2f2f2 !important;
    border-color: #d0d0d0 !important;
    color: #0f0f0f !important;
}

html[data-theme="light"] .channel-banner {
    background: linear-gradient(135deg, #e8f4fd 0%, #dbeafe 50%, #bfdbfe 100%) !important;
}

html[data-theme="light"] .channel-empty-state {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

html[data-theme="light"] .channel-empty-icon {
    background: #f0f0f0 !important;
    border-color: #e0e0e0 !important;
}

html[data-theme="light"] .channel-empty-icon svg {
    fill: #606060 !important;
}

html[data-theme="light"] .channel-empty-state {
    background: linear-gradient(180deg, #f9f9f9, #f2f2f2);
    border-color: #e5e5e5;
}

html[data-theme="light"] .channel-empty-title {
    color: #0f0f0f;
}

html[data-theme="light"] .channel-empty-text {
    color: #606060;
}

html[data-theme="light"] .channel-empty-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .channel-empty-btn:hover {
    background: #e5e5e5;
}

/* ── Playlist page ───────────────────────────────────────────── */
html[data-theme="light"] .pl-thumb {
    background: #e5e5e5;
}

html[data-theme="light"] .pl-thumb-empty {
    color: #909090;
}

html[data-theme="light"] .pl-name {
    color: #0f0f0f;
}

html[data-theme="light"] .pl-meta {
    color: #606060;
}

html[data-theme="light"] .pl-back-btn {
    color: #0f0f0f;
}

html[data-theme="light"] .pl-back-btn:hover {
    background: #e5e5e5;
}

html[data-theme="light"] .pl-video-thumb {
    background: #e5e5e5;
}

html[data-theme="light"] .pl-video-title {
    color: #0f0f0f;
}

html[data-theme="light"] .pl-video-meta {
    color: #606060;
}

html[data-theme="light"] .pl-video-remove {
    color: #909090;
}

html[data-theme="light"] .pl-empty {
    color: #606060;
}

html[data-theme="light"] .pl-modal-cancel {
    background: #f2f2f2;
    color: #0f0f0f;
}

/* ── Admin page ──────────────────────────────────────────────── */
html[data-theme="light"] .admin-title {
    color: #0f0f0f;
}

html[data-theme="light"] .tab-bar {
    border-bottom-color: #e5e5e5;
}

html[data-theme="light"] .tab-btn {
    color: #606060;
}

html[data-theme="light"] .tab-btn.active {
    color: #0f0f0f;
    border-bottom-color: #0f0f0f;
}

html[data-theme="light"] .tab-panel th {
    background: #f5f5f5;
    color: #606060;
    border-bottom-color: #e5e5e5;
}

html[data-theme="light"] .tab-panel td {
    border-bottom-color: #f0f0f0;
    color: #0f0f0f;
}

html[data-theme="light"] .tab-panel tr:hover td {
    background: #f5f5f5;
}

html[data-theme="light"] .btn-role {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #606060;
}

html[data-theme="light"] .btn-role.btn-role-admin {
    background: #ede9ff;
    border-color: #c5b8ff;
    color: #5b3fd8;
}

html[data-theme="light"] .btn-action {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .count-badge {
    color: #0f0f0f;
}

html[data-theme="light"] .empty-msg {
    color: #909090;
}

/* ── Studio dashboard page ───────────────────────────────────── */
html[data-theme="light"] .studio-chart-wrap {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

html[data-theme="light"] .studio-tabs {
    border-bottom-color: #e5e5e5 !important;
}

html[data-theme="light"] .studio-tab-btn {
    color: #606060 !important;
}

html[data-theme="light"] .studio-tab-btn:hover {
    color: #0f0f0f !important;
}

html[data-theme="light"] .studio-tab-btn.is-active {
    color: #0f0f0f !important;
    border-bottom-color: #0f0f0f !important;
}

html[data-theme="light"] .studio-chart-empty {
    color: #909090 !important;
}

html[data-theme="light"] .studio-chart-wrap svg line {
    stroke: #e5e5e5 !important;
}

html[data-theme="light"] .studio-chart-wrap svg text {
    fill: #606060 !important;
}

html[data-theme="light"] .studio-chart-wrap svg polyline,
html[data-theme="light"] .studio-chart-wrap svg path {
    stroke: #3ea6ff !important;
}

html[data-theme="light"] .studio-chart-wrap svg circle {
    fill: #3ea6ff !important;
    stroke: #ffffff !important;
}

/* ── Creator dashboard (channel page) ───────────────────────── */
html[data-theme="light"] .creator-dashboard-card,
html[data-theme="light"] .creator-dashboard-panel {
    background: #ffffff;
    border-color: #e5e5e5;
}

html[data-theme="light"] .creator-dashboard-card p {
    color: #606060;
}

html[data-theme="light"] .creator-dashboard-card strong {
    color: #0f0f0f;
}

html[data-theme="light"] .creator-dashboard-title {
    color: #0f0f0f;
}

html[data-theme="light"] .creator-dashboard-bar-top {
    color: #0f0f0f;
}

html[data-theme="light"] .creator-dashboard-bar-top strong {
    color: #606060;
}

html[data-theme="light"] .creator-dashboard-bar-track {
    background: #e5e5e5;
}

html[data-theme="light"] .creator-dashboard-rank-row {
    border-bottom-color: #e5e5e5;
    color: #606060;
}

html[data-theme="light"] .creator-dashboard-rank-row strong {
    color: #0f0f0f;
}

html[data-theme="light"] .creator-dashboard-rank-row em {
    color: #606060;
}

html[data-theme="light"] .creator-dashboard-empty {
    color: #909090;
}

/* ── Confirm modal ───────────────────────────────────────────── */
html[data-theme="light"] .confirm-modal {
    background: #ffffff;
    border-color: #e5e5e5;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .confirm-modal-title {
    color: #0f0f0f;
}

html[data-theme="light"] .confirm-modal-message {
    color: #606060;
}

html[data-theme="light"] .confirm-modal-btn {
    background: #f2f2f2;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .confirm-modal-btn:hover {
    background: #e5e5e5;
}

/* ── Watch description box ───────────────────────────────────── */
html[data-theme="light"] .watch-description-box {
    background: #f2f2f2;
    color: #0f0f0f;
}

html[data-theme="light"] .watch-description-toggle {
    color: #0f0f0f;
}

/* ── Upload clean layout ─────────────────────────────────────── */
html[data-theme="light"] body.upload-clean-layout {
    background: #f9f9f9 !important;
}

/* ── Studio page — header & upload btn ──────────────────────── */
html[data-theme="light"] .studio-header h1 {
    color: #0f0f0f;
}

html[data-theme="light"] .studio-upload-btn {
    background: #0f0f0f !important;
    color: #ffffff !important;
}

html[data-theme="light"] .studio-upload-btn:hover {
    background: #272727 !important;
}

/* ── Studio analytics extra panels (sa-) ────────────────────── */
html[data-theme="light"] .sa-panel {
    background: #ffffff !important;
    border-color: #e5e5e5 !important;
}

html[data-theme="light"] .sa-panel-title {
    color: #909090 !important;
}

html[data-theme="light"] .sa-rank-row {
    border-bottom-color: #f0f0f0 !important;
}

html[data-theme="light"] .sa-rank-title {
    color: #0f0f0f !important;
}

html[data-theme="light"] .sa-rank-views {
    color: #606060 !important;
}

html[data-theme="light"] .sa-bar-meta span {
    color: #606060 !important;
}

html[data-theme="light"] .sa-bar-meta strong {
    color: #0f0f0f !important;
}

html[data-theme="light"] .sa-bar-track {
    background: #e8e8e8 !important;
}

html[data-theme="light"] .sa-engagement-item {
    border-right-color: #e5e5e5 !important;
    border-bottom-color: #e5e5e5 !important;
}

html[data-theme="light"] .sa-engagement-label {
    color: #909090 !important;
}

html[data-theme="light"] .sa-engagement-value {
    color: #0f0f0f !important;
}

html[data-theme="light"] .sa-empty {
    color: #aaa !important;
}

/* ── Studio stats-grid SVG chart (bar chart) ────────────────── */
html[data-theme="light"] .studio-chart-wrap svg rect {
    fill: #3ea6ff !important;
}

html[data-theme="light"] .studio-chart-wrap svg line {
    stroke: #e5e5e5 !important;
}

html[data-theme="light"] .studio-chart-wrap svg text {
    fill: #606060 !important;
}

/* ── 이어보기 토스트 ────────────────────────────────────────── */
.resume-toast {
    position: absolute;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(28, 28, 28, 0.92);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 8px 14px;
    white-space: nowrap;
    z-index: 50;
    animation: resumeToastIn 0.25s ease;
    backdrop-filter: blur(4px);
}

@keyframes resumeToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.resume-toast-text {
    font-size: 13px;
    color: #e8e8e8;
}

.resume-toast-btn {
    border: none;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.resume-toast-btn.resume-btn {
    background: #3ea6ff;
    color: #0f0f0f;
}

.resume-toast-btn.resume-btn:hover {
    background: #63b8ff;
}

.resume-toast-btn.dismiss-btn {
    background: rgba(255,255,255,0.1);
    color: #e8e8e8;
}

.resume-toast-btn.dismiss-btn:hover {
    background: rgba(255,255,255,0.18);
}

html[data-theme="light"] .resume-toast {
    background: rgba(240, 240, 240, 0.95);
    border-color: rgba(0,0,0,0.1);
}

html[data-theme="light"] .resume-toast-text {
    color: #0f0f0f;
}

html[data-theme="light"] .resume-toast-btn.resume-btn {
    background: #065fd4;
    color: #fff;
}

html[data-theme="light"] .resume-toast-btn.dismiss-btn {
    background: rgba(0,0,0,0.08);
    color: #0f0f0f;
}

/* ── Share modal ────────────────────────────────────────────── */
.share-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.share-modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.share-modal {
    width: calc(100% - 32px);
    max-width: 440px;
    background: #212121;
    border: 1px solid #303030;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.5);
    transform: translateY(8px);
    transition: transform 0.18s ease;
}

.share-modal-backdrop.show .share-modal {
    transform: translateY(0);
}

/* 신고 모달 (share-modal 구조 재사용) */
.report-modal-reasons {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 8px 0 12px;
}

.report-reason-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
    color: #f1f1f1;
    font-size: 14px;
    transition: background 0.15s;
}

.report-reason-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.report-reason-option input {
    accent-color: #3ea6ff;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.report-modal-detail {
    width: 100%;
    background: #121212;
    border: 1px solid #303030;
    border-radius: 8px;
    color: #f1f1f1;
    padding: 10px 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 64px;
    box-sizing: border-box;
}

.report-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.report-cancel-btn,
.report-submit-btn {
    height: 36px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.report-cancel-btn {
    background: transparent;
    color: #3ea6ff;
}

.report-cancel-btn:hover {
    background: rgba(62, 166, 255, 0.1);
}

.report-submit-btn {
    background: #c00;
    color: #fff;
}

.report-submit-btn:hover {
    background: #a00;
}

.report-submit-btn:disabled {
    background: #333;
    color: #888;
    cursor: default;
}

html[data-theme="light"] .report-reason-option {
    color: #0f0f0f;
}

html[data-theme="light"] .report-reason-option:hover {
    background: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .report-modal-detail {
    background: #fff;
    border-color: #ccc;
    color: #0f0f0f;
}

html[data-theme="light"] .report-submit-btn:disabled {
    background: #e5e5e5;
    color: #aaa;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.share-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.share-modal-close:hover {
    background: #333;
    color: #fff;
}

.share-modal-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.share-modal-input {
    flex: 1;
    background: #0f0f0f;
    border: 1px solid #303030;
    border-radius: 8px;
    color: #f1f1f1;
    font-size: 13px;
    padding: 8px 12px;
    min-width: 0;
    outline: none;
}

.share-modal-copy-btn {
    background: #3ea6ff;
    color: #0f0f0f;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.share-modal-copy-btn:hover {
    background: #63b8ff;
}

.share-modal-copy-btn.copied {
    background: #3dba7e;
    color: #fff;
}

.share-modal-timestamp {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
    user-select: none;
}

.share-modal-timestamp input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3ea6ff;
}

html[data-theme="light"] .share-modal {
    background: #ffffff;
    border-color: #e5e5e5;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .share-modal-title {
    color: #0f0f0f;
}

html[data-theme="light"] .share-modal-close {
    color: #606060;
}

html[data-theme="light"] .share-modal-close:hover {
    background: #f2f2f2;
    color: #0f0f0f;
}

html[data-theme="light"] .share-modal-input {
    background: #f8f8f8;
    border-color: #d0d0d0;
    color: #0f0f0f;
}

html[data-theme="light"] .share-modal-copy-btn {
    background: #065fd4;
    color: #fff;
}

html[data-theme="light"] .share-modal-copy-btn:hover {
    background: #0b6bcb;
}

html[data-theme="light"] .share-modal-timestamp {
    color: #606060;
}

/* ── 댓글 더 보기 버튼 ──────────────────────────────────── */
.comment-load-more {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: none;
    border: 1px solid #303030;
    border-radius: 20px;
    color: #3ea6ff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.comment-load-more:hover {
    background: rgba(62, 166, 255, 0.08);
}

.comment-load-more:disabled {
    color: #aaa;
    cursor: default;
}

html[data-theme="light"] .comment-load-more {
    border-color: #d0d0d0;
    color: #065fd4;
}

html[data-theme="light"] .comment-load-more:hover {
    background: rgba(6, 95, 212, 0.06);
}

/* ── 추천 영상 태그 ──────────────────────────────────────── */
.recommend-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: rgba(62, 166, 255, 0.15);
    color: #3ea6ff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}

html[data-theme="light"] .recommend-tag {
    background: rgba(6, 95, 212, 0.1);
    color: #065fd4;
}

/* ── 극장 모드 ───────────────────────────────────────────── */
body.theater-mode .watch-shell { align-items: flex-start; min-height: 0; }
body.theater-mode .watch-shell > aside.sidebar { display: none !important; }
body.theater-mode .watch-page { padding-left: 0 !important; padding-right: 0 !important; }
body.theater-mode .watch-layout { flex-direction: column !important; max-width: 100%; gap: 0; }
body.theater-mode .watch-side-column { position: static; padding: 0 24px; }
body.theater-mode .watch-main-column { max-width: 100%; }
body.theater-mode .player-box { aspect-ratio: 16/9; max-height: 80vh; border-radius: 0; }
body.theater-mode #customPlayer,
body.theater-mode .player-video { max-height: 80vh; border-radius: 0; }
body.theater-mode .watch-title,
body.theater-mode .watch-meta-row,
body.theater-mode .watch-description-box,
body.theater-mode .comments-section { padding-left: 24px; padding-right: 24px; }

/* 극장 모드 - 추천 영상 가로 캐러셀 */
body.theater-mode .watch-side-column {
    position: static;
    padding: 8px 24px 0;
    margin-top: 8px;
}

body.theater-mode .watch-recommend-header {
    margin-bottom: 14px;
}

body.theater-mode .watch-recommend-header-default {
    display: none;
}

body.theater-mode .watch-recommend-chipbar,
body.theater-mode .watch-recommend-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.theater-mode .watch-recommend-chipbar {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

body.theater-mode .watch-recommend-chipbar::-webkit-scrollbar {
    display: none;
}

body.theater-mode .watch-recommend-panel {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

body.theater-mode .watch-recommend-list {
    flex-direction: row;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    padding-bottom: 8px;
    scrollbar-width: none;
}

body.theater-mode .watch-recommend-list::-webkit-scrollbar {
    display: none;
}

body.theater-mode .recommend-card {
    flex-direction: column;
    flex-shrink: 0;
    width: 280px;
    gap: 8px;
    padding: 0;
}

body.theater-mode .recommend-thumb {
    width: 100%;
    min-width: 0;
}

body.theater-mode .recommend-info {
    padding-top: 0;
}

/* ── 영상 종료 오버레이 ──────────────────────────────────── */
/* ── 영상 종료 오버레이 (플레이어 중앙 미니카드) ─────────── */
.video-end-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: inherit;
    z-index: 50;
    animation: fadeIn 0.25s ease;
    pointer-events: auto;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.video-end-card {
    display: flex;
    flex-direction: column;
    width: 320px;
    max-width: 86%;
    background: rgba(28,28,28,0.97);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}

.video-end-thumb-link {
    position: relative;
    display: block;
    line-height: 0;
}

.video-end-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.video-end-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
}

.video-end-info {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.video-end-label {
    font-size: 13px;
    color: #aaa;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.video-end-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.video-end-ch {
    font-size: 13px;
    color: #aaa;
    margin: 0;
}

.video-end-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.video-end-play-btn {
    display: inline-flex;
    align-items: center;
    background: #fff;
    color: #0f0f0f;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 18px;
    text-decoration: none;
    transition: background 0.15s;
    flex: 1;
    justify-content: center;
}

.video-end-play-btn:hover { background: #ddd; }

.video-end-countdown { font-size: 15px; }

.video-end-cancel-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #ccc;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 18px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.video-end-cancel-btn:hover { background: rgba(255,255,255,0.1); }

@media (max-width: 500px) {
    .video-end-card { width: 280px; }
}

/* ── 시청 기록 날짜 그룹핑 ──────────────────────────────── */
.history-grouped-root { padding: 0 4px; }

.history-date-group { margin-bottom: 28px; }

.history-date-label {
    font-size: 16px;
    font-weight: 600;
    color: #f1f1f1;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #282828;
}

html[data-theme="light"] .history-date-label {
    color: #0f0f0f;
    border-bottom-color: #e0e0e0;
}

/* ── 검색 필터 바 ────────────────────────────────────────── */
.search-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0 16px;
    border-bottom: 1px solid #282828;
    margin-bottom: 16px;
}

.search-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-filter-label {
    font-size: 13px;
    color: #aaa;
    white-space: nowrap;
    min-width: 36px;
}

.search-filter-btn {
    background: transparent;
    border: 1px solid #3d3d3d;
    color: #e0e0e0;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.search-filter-btn:hover {
    background: rgba(255,255,255,0.07);
    border-color: #aaa;
}

.search-filter-btn.is-active {
    background: #f1f1f1;
    border-color: #f1f1f1;
    color: #0f0f0f;
    font-weight: 600;
}

html[data-theme="light"] .search-filter-bar {
    border-bottom-color: #e0e0e0;
}

html[data-theme="light"] .search-filter-label { color: #606060; }

html[data-theme="light"] .search-filter-btn {
    border-color: #ccc;
    color: #0f0f0f;
}

html[data-theme="light"] .search-filter-btn:hover {
    background: rgba(0,0,0,0.05);
    border-color: #888;
}

html[data-theme="light"] .search-filter-btn.is-active {
    background: #0f0f0f;
    border-color: #0f0f0f;
    color: #fff;
}

/* ── 댓글 정렬 버튼 ─────────────────────────────────────── */
.comments-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.comment-sort-btns {
    display: flex;
    gap: 6px;
}

.comment-sort-btn {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.comment-sort-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #f1f1f1;
}

.comment-sort-btn.is-active {
    background: rgba(255,255,255,0.12);
    color: #f1f1f1;
    font-weight: 600;
}

html[data-theme="light"] .comment-sort-btn {
    color: #606060;
}

html[data-theme="light"] .comment-sort-btn:hover {
    background: rgba(0,0,0,0.06);
    color: #0f0f0f;
}

html[data-theme="light"] .comment-sort-btn.is-active {
    background: rgba(0,0,0,0.08);
    color: #0f0f0f;
}

/* ── 검색 자동완성 드롭다운 ─────────────────────────────── */
.search-suggest-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #212121;
    border: 1px solid #333;
    border-radius: 12px;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 300;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    display: none;
}

.search-suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 14px;
    color: #e0e0e0;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggest-item:hover,
.search-suggest-item.is-active {
    background: #2d2d2d;
}

.search-suggest-icon {
    flex-shrink: 0;
    opacity: 0.5;
}

html[data-theme="light"] .search-suggest-list {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

html[data-theme="light"] .search-suggest-item {
    color: #0f0f0f;
}

html[data-theme="light"] .search-suggest-item:hover,
html[data-theme="light"] .search-suggest-item.is-active {
    background: #f2f2f2;
}

/* ── 카드 구독 버튼 ─────────────────────────────────────── */
.channel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.channel-row .channel-link {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-sub-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 20px;
    color: #f1f1f1;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.card-sub-btn:hover {
    background: rgba(255,255,255,0.2);
}

.card-sub-btn.is-subscribed {
    background: rgba(255,255,255,0.08);
    color: #aaa;
}

.card-sub-btn.is-subscribed:hover {
    background: rgba(255,80,80,0.15);
    color: #ff5050;
}

html[data-theme="light"] .card-sub-btn {
    background: rgba(0,0,0,0.08);
    color: #0f0f0f;
}

html[data-theme="light"] .card-sub-btn:hover {
    background: rgba(0,0,0,0.14);
}

html[data-theme="light"] .card-sub-btn.is-subscribed {
    background: rgba(0,0,0,0.05);
    color: #606060;
}

html[data-theme="light"] .card-sub-btn.is-subscribed:hover {
    background: rgba(255,0,0,0.1);
    color: #c00;
}

/* ── 채널 링크 ──────────────────────────────────────────── */
.avatar-link {
    flex-shrink: 0;
    display: block;
    border-radius: 50%;
}

.channel-link {
    display: block;
    text-decoration: none;
    color: #aaaaaa;
    transition: color 0.15s;
}

.channel-link:hover {
    color: #f1f1f1;
    text-decoration: underline;
}

html[data-theme="light"] .channel-link {
    color: #606060;
}

html[data-theme="light"] .channel-link:hover {
    color: #0f0f0f;
}

/* ── 스켈레톤 로딩 ───────────────────────────────────────── */
@keyframes skeleton-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 10px;
    background: linear-gradient(90deg, #222 25%, #333 50%, #222 75%);
    background-size: 600px 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
}

.skeleton-meta {
    display: flex;
    gap: 12px;
}

.skeleton-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, #222 25%, #333 50%, #222 75%);
    background-size: 600px 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 2px;
}

.skeleton-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #222 25%, #333 50%, #222 75%);
    background-size: 600px 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.shorter { width: 40%; height: 12px; }

html[data-theme="light"] .skeleton-thumb,
html[data-theme="light"] .skeleton-avatar,
html[data-theme="light"] .skeleton-line {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 600px 100%;
}

/* ── 영상 카드 시청 진행 바 ──────────────────────────────── */
.card-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #f00;
    border-radius: 0 0 2px 2px;
    pointer-events: none;
    transition: width 0.3s ease;
}

/* ── 공유 모달 SNS 버튼 ──────────────────────────────────── */
.share-sns-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.share-sns-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid #3a3a3a;
    background: #1e1e1e;
    color: #f1f1f1;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    white-space: nowrap;
}

.share-sns-btn:hover { background: #2a2a2a; border-color: #555; }

.share-sns-btn.kakao { border-color: #f9e000; color: #3c1e1e; background: #fee500; }
.share-sns-btn.kakao:hover { background: #f0d800; border-color: #f0d800; }

.share-sns-btn.twitter { border-color: #1d9bf0; }
.share-sns-btn.twitter:hover { background: rgba(29,155,240,0.12); }

.share-sns-btn.native { border-color: #55a; }
.share-sns-btn.native:hover { background: rgba(100,100,200,0.12); }

html[data-theme="light"] .share-sns-btn { background: #f5f5f5; border-color: #ccc; color: #0f0f0f; }
html[data-theme="light"] .share-sns-btn:hover { background: #ebebeb; }

/* ── 댓글 글자 수 카운터 ─────────────────────────────────── */
.comment-char-counter {
    font-size: 12px;
    color: #7a7a7a;
    align-self: center;
    margin-left: auto;
    flex-shrink: 0;
}

.comment-char-counter.near-limit { color: #f8b400; }
.comment-char-counter.at-limit   { color: #f44; }

html[data-theme="light"] .comment-char-counter { color: #999; }

/* ── 플레이어 스킵 버튼 ──────────────────────────────────── */
.cp-skip-zone {
    position: absolute;
    top: 0;
    width: 24%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
    gap: 6px;
}

.cp-skip-zone.left-zone  { left: 0; }
.cp-skip-zone.right-zone { right: 0; }
.cp-skip-zone.flash { opacity: 1; }

.cp-skip-zone svg { filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }

/* ── 챕터 목록 ───────────────────────────────────────────────── */
.chapter-list {
    background: #181818;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chapter-list-title {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    background: none;
    color: #f1f1f1;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.chapter-item:hover { background: #272727; }
.chapter-timestamp {
    color: #3ea6ff;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 44px;
}
.chapter-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ts-link {
    background: none;
    border: none;
    color: #3ea6ff;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
}
.ts-link:hover { text-decoration: underline; }
html[data-theme="light"] .chapter-list { background: #f2f2f2; }
html[data-theme="light"] .chapter-item { color: #0f0f0f; }
html[data-theme="light"] .chapter-item:hover { background: #e0e0e0; }

/* ═══════════════════════════════════════════════════════════
   UNIFIED RESPONSIVE SIDEBAR & LAYOUT
   - 모든 페이지 사이드바 공통 반응형 규칙
   ═══════════════════════════════════════════════════════════ */

/* Mobile & Tablet: sidebar as overlay (≤900px) */
@media (max-width: 900px) {
    /* Sidebar: fixed overlay, slide in/out */
    .sidebar,
    #sidebar {
        position: fixed !important;
        top: 56px !important;
        left: 0 !important;
        width: 240px !important;
        height: calc(100vh - 56px) !important;
        z-index: 120 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.25s ease !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .sidebar.is-open,
    #sidebar.is-open {
        transform: translateX(0) !important;
    }

    /* Sidebar items: always full-row layout on mobile */
    .sidebar .sidebar-item,
    #sidebar .sidebar-item,
    .sidebar.is-collapsed .sidebar-item,
    #sidebar.is-collapsed .sidebar-item {
        width: 100% !important;
        min-height: 44px !important;
        height: 44px !important;
        flex-direction: row !important;
        padding: 0 16px !important;
        gap: 18px !important;
        justify-content: flex-start !important;
        align-items: center !important;
        text-align: left !important;
        white-space: nowrap !important;
    }

    .sidebar .sidebar-label,
    #sidebar .sidebar-label,
    .sidebar.is-collapsed .sidebar-label,
    #sidebar.is-collapsed .sidebar-label {
        display: inline-flex !important;
        font-size: 14px !important;
        white-space: nowrap !important;
        text-align: left !important;
        width: auto !important;
        min-height: auto !important;
    }

    .sidebar .sidebar-icon,
    #sidebar .sidebar-icon,
    .sidebar.is-collapsed .sidebar-icon {
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    /* Main content: no left margin on mobile */
    .main,
    #main,
    main,
    .home-main,
    .search-main,
    .history-main,
    .saved-main,
    .liked-main,
    .sub-feed-main,
    .user-channel-content,
    .playlist-main,
    .channel-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Backdrop: global overlay */
    .mobile-sidebar-backdrop {
        display: block !important;
        position: fixed !important;
        inset: 56px 0 0 0 !important;
        background: rgba(0, 0, 0, 0.45) !important;
        z-index: 110 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.2s ease !important;
    }

    .mobile-sidebar-backdrop.is-open {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

/* Desktop: hide backdrop */
@media (min-width: 901px) {
    .mobile-sidebar-backdrop {
        display: none !important;
    }
}

/* Small phone (≤480px): shrink topbar elements */
@media (max-width: 480px) {
    .topbar-left {
        gap: 4px !important;
    }

    .topbar-right {
        gap: 6px !important;
        min-width: 0 !important;
    }

    .logo-badge {
        width: 28px !important;
        height: 28px !important;
    }

    .search-form {
        min-width: 0 !important;
    }

    .search-form input {
        min-width: 0 !important;
    }
}
