.content-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.history-page {
    max-width: 1120px;
    margin: 0 auto;
}

.history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.history-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.history-heading p {
    margin: 0;
    color: var(--muted);
}

.history-clear-button,
.history-search button {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
}

.history-clear-button:hover,
.history-search button:hover,
.history-remove-button:hover {
    background: rgba(148, 163, 184, 0.22);
}

.history-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 34px;
    align-items: start;
}

.history-results {
    min-width: 0;
}

.history-day + .history-day {
    margin-top: 30px;
}

.history-day h2 {
    margin: 0 0 14px;
    font-size: 1.1rem;
}

.history-item {
    display: grid;
    grid-template-columns: minmax(170px, 240px) minmax(0, 1fr) 40px;
    gap: 16px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.history-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    background-color: var(--panel-soft);
    background-position: center;
    background-size: cover;
}

.history-thumb span {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 0.75rem;
}

.history-item-info {
    min-width: 0;
}

.history-item-info h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    line-height: 1.4;
}

.history-item-info h3 a {
    color: var(--text);
}

.history-item-info p,
.history-item-info time {
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.86rem;
}

.history-remove-form {
    display: flex;
    justify-content: center;
}

.history-remove-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 1.4rem;
}

.history-tools {
    position: sticky;
    top: 96px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.72);
}

.history-search label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
}

.history-search div {
    display: flex;
    gap: 8px;
}

.history-search input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 12px;
    background: var(--bg);
    color: var(--text);
}

.history-reset-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.9rem;
}

.watch-later-page {
    max-width: 1120px;
    margin: 0 auto;
}

.watch-later-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.watch-later-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.watch-later-heading p {
    margin: 0;
    color: var(--muted);
}

.watch-later-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.watch-later-play,
.watch-later-actions button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 9px 15px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.watch-later-play {
    background: var(--accent);
    color: #fff;
}

.watch-later-list {
    margin-top: 18px;
}

.watch-later-item {
    display: grid;
    grid-template-columns: 28px minmax(180px, 260px) minmax(0, 1fr) 40px;
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.watch-later-number {
    color: var(--muted);
    text-align: center;
}

.watch-later-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    background-color: var(--panel-soft);
    background-position: center;
    background-size: cover;
}

.watch-later-thumb > span {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 0.75rem;
}

.watch-later-info {
    min-width: 0;
}

.watch-later-info h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    line-height: 1.4;
}

.watch-later-info h2 a {
    color: var(--text);
}

.watch-later-info p,
.watch-later-info time {
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.86rem;
}

.watch-later-remove {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 1.4rem;
}

.watch-later-remove:hover,
.watch-later-actions button:hover {
    background: rgba(148, 163, 184, 0.22);
}

.subscriptions-page {
    max-width: 1280px;
    margin: 0 auto;
}

.subscriptions-heading {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.subscriptions-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.subscriptions-heading p {
    margin: 0;
    color: var(--muted);
}

.subscription-channels {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.subscription-channel {
    display: flex;
    flex: 0 0 88px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-align: center;
    font-size: 0.8rem;
}

.subscription-channel img,
.subscription-avatar {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 50%;
    background: var(--panel-soft);
    color: var(--text);
    object-fit: cover;
    font-weight: 700;
}

.subscription-channel.active,
.subscription-channel:hover {
    color: var(--text);
}

.subscription-channel.active img,
.subscription-channel.active .subscription-avatar {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.subscriptions-feed {
    padding-top: 24px;
}

.subscriptions-video-grid .feature-card {
    min-width: 0;
}

.subscriptions-manage {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.subscriptions-manage h2 {
    margin: 0 0 14px;
    font-size: 1.2rem;
}

.subscription-manage-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.subscription-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(17, 24, 39, 0.72);
}

.subscription-manage-item > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.subscription-manage-item span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
}

.subscription-form button,
.subscriptions-empty a {
    border: 0;
    border-radius: 999px;
    padding: 9px 13px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.subscription-form button:hover,
.subscriptions-empty a:hover {
    background: rgba(148, 163, 184, 0.22);
}

.subscriptions-empty {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-top: 48px;
    padding: 42px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.72);
    text-align: center;
}

.subscriptions-empty h2,
.subscriptions-empty p {
    margin: 0;
}

.subscriptions-empty p {
    max-width: 560px;
    color: var(--muted);
    line-height: 1.6;
}

.subscriptions-empty a {
    margin-top: 8px;
}

.playlist-page {
    max-width: 1120px;
    margin: 0 auto;
}

.playlist-list-heading,
.playlist-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.playlist-list-heading h1,
.playlist-detail-heading h1 {
    margin: 8px 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.playlist-list-heading p,
.playlist-detail-heading p,
.playlist-detail-heading > div > span {
    color: var(--muted);
}

.playlist-list-heading p,
.playlist-detail-heading p {
    margin: 0 0 8px;
}

.playlist-back-link,
.playlist-detail-heading > div > span {
    font-size: 0.9rem;
}

.playlist-back-link {
    color: var(--muted);
}

.playlist-create,
.playlist-edit {
    width: fit-content;
    max-width: 100%;
}

.playlist-create > summary,
.playlist-edit > summary {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.playlist-create > summary::-webkit-details-marker,
.playlist-edit > summary::-webkit-details-marker {
    display: none;
}

.playlist-form {
    display: grid;
    gap: 14px;
    width: min(640px, calc(100vw - 48px));
    margin-top: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.86);
}

.playlist-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
}

.playlist-form input,
.playlist-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: var(--bg);
    color: var(--text);
}

.playlist-form textarea {
    min-height: 84px;
    resize: vertical;
}

.playlist-form button,
.playlist-play-button,
.playlist-delete-form button {
    width: fit-content;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.playlist-collection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.playlist-card {
    display: grid;
    gap: 8px;
    color: var(--text);
}

.playlist-card-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--panel-soft), var(--panel-alt));
    background-position: center;
    background-size: cover;
    overflow: hidden;
}

.playlist-card-cover::after {
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    content: "";
}

.playlist-card-cover > span {
    position: absolute;
    z-index: 1;
    right: 9px;
    bottom: 9px;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.8rem;
}

.playlist-card-title {
    font-weight: 700;
}

.playlist-card-meta {
    color: var(--muted);
    font-size: 0.83rem;
}

.playlist-play-button {
    flex: 0 0 auto;
    text-decoration: none;
}

.playlist-edit {
    margin-top: 20px;
}

.playlist-delete-form {
    margin-top: 10px;
}

.playlist-delete-form button {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.playlist-video-list {
    margin-top: 22px;
}

.playlist-video-item {
    display: grid;
    grid-template-columns: 32px minmax(160px, 220px) minmax(0, 1fr) 40px;
    gap: 14px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.playlist-video-position {
    color: var(--muted);
    text-align: center;
}

.playlist-video-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: var(--panel-soft);
    background-position: center;
    background-size: cover;
}

.playlist-video-thumb > span {
    position: absolute;
    right: 7px;
    bottom: 7px;
    padding: 3px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 0.75rem;
}

.playlist-video-info {
    min-width: 0;
}

.playlist-video-info h2 {
    margin: 0 0 7px;
    font-size: 1rem;
}

.playlist-video-info h2 a {
    color: var(--text);
}

.playlist-video-info p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.playlist-remove-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 1.4rem;
}

.playlist-video-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.playlist-video-actions form {
    margin: 0;
}

.playlist-remove-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.playlist-message {
    padding: 12px 16px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 12px;
    color: #fca5a5;
}

.add-to-playlist {
    margin-top: 14px;
}

.add-to-playlist > summary {
    display: inline-block;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    cursor: pointer;
    list-style: none;
}

.add-to-playlist-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.add-to-playlist-options button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text);
    cursor: pointer;
}

@media (max-width: 760px) {
    .history-layout {
        grid-template-columns: 1fr;
    }

    .history-tools {
        position: static;
        grid-row: 1;
    }
}

@media (max-width: 520px) {
    .history-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-item {
        grid-template-columns: 112px minmax(0, 1fr) 32px;
        gap: 10px;
    }

    .playlist-detail-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .playlist-video-item {
        grid-template-columns: 24px 112px minmax(0, 1fr) 32px;
        gap: 8px;
    }

    .history-item-info h3 {
        font-size: 0.9rem;
    }

    .watch-later-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .watch-later-actions {
        flex-wrap: wrap;
    }

    .watch-later-item {
        grid-template-columns: 20px 112px minmax(0, 1fr) 32px;
        gap: 8px;
    }

    .watch-later-info h2 {
        font-size: 0.88rem;
    }
}

.compact {
    padding: 24px 28px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
}

.feature-card,
.feature-thumb,
.stat-card,
.info-block,
.setting-item,
.empty-state-compact,
.search-header,
.result-card {
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.feature-card {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: rgba(148, 163, 184, 0.28);
}

.feature-thumb {
    position: relative;
    display: block;
    height: 170px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.feature-duration {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 8px;
    padding: 4px 7px;
    font-size: 0.74rem;
    font-weight: 700;
}

.feature-body {
    padding: 16px 14px 18px;
}

.feature-body h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.feature-subtitle,
.feature-meta {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.84rem;
}

.feature-body a {
    color: var(--text);
    text-decoration: none;
}

.feature-thumb {
    position: relative;
    display: block;
    height: 180px;
    background-size: cover;
    background-position: center;
}

.feature-duration {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-block;
    background: rgba(15, 23, 42, 0.92);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.76rem;
    font-weight: 700;
}

.feature-body {
    padding: 16px;
}

.feature-body h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.feature-subtitle,
.feature-meta {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.empty-state-compact {
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    color: var(--muted);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.stat-card {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.86));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card strong {
    font-size: 2rem;
    color: #fff;
}

.stat-card span {
    color: var(--muted);
}

.info-block {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 22px 20px;
}

.info-block h2 {
    margin-top: 0;
}

.info-block p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.setting-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 18px 20px;
}

.setting-item h3 {
    margin: 0 0 8px;
}

.setting-item p {
    margin: 0;
    color: var(--muted);
}

.setting-pill {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #86efac;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.auth-card {
    width: min(420px, 100%);
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 28px 24px;
    box-shadow: var(--shadow);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.auth-card h1 {
    margin: 0 0 8px;
}

.auth-card p {
    margin: 0 0 18px;
    color: var(--muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
    padding: 12px 14px;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.08);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.google-button {
    margin-bottom: 18px;
}

.primary-button {
    background: #ef4444;
    border-color: transparent;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--muted);
    margin: 12px 0 18px;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.divider span {
    padding: 0 12px;
}
