/* ==========================================================================
   MyTubu - Modern Minimalist Dark Curation Feed (Zero Red Redesign)
   Inspired by Apple, Twitter/X, Linear & Vercel
   ========================================================================== */

:root {
    --bg-base: #090b10;
    --bg-surface: #121622;
    --bg-elevated: #181d2d;
    --bg-glass: rgba(18, 22, 34, 0.8);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --border-focus: #3b82f6;
    
    /* Clean Blue / Indigo Accent (No Red!) */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --accent-glow: rgba(59, 130, 246, 0.25);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --heart-active: #f43f5e; /* Elegant Rose for favorites */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* ==========================================================================
   Auth Page (login.php)
   ========================================================================== */
.auth-page {
    min-height: 100dvh;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 15%, #151a28 0%, #090b10 100%);
    padding: 24px 16px;
}

.auth-wrapper {
    width: 100%;
    max-width: 400px;
    margin: auto;
}

.auth-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 34px 26px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.auth-header {
    text-align: center;
    margin-bottom: 26px;
}

.logo-icon {
    font-size: 38px;
    line-height: 1;
    margin-bottom: 10px;
}

.logo-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.auth-mode-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-setup {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.3);
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    height: 48px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 16px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-control {
    padding-right: 44px;
}

.btn-toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
}

.form-row.remember-row {
    margin-bottom: 22px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-block {
    width: 100%;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 16px;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fb7185;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.security-badge {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.btn-text-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

/* ==========================================================================
   Main App Layout
   ========================================================================== */
.app-container {
    width: 100%;
    height: 100dvh;
    max-width: 540px; /* Comfortable mobile & desktop width */
    margin: 0 auto;
    position: relative;
    background: var(--bg-base);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
.shorts-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--safe-top) + 10px) 16px 10px;
    background: rgba(9, 11, 16, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.3px;
}

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

.brand-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

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

.btn-view-mode {
    height: 34px;
    padding: 0 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-mode:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.12);
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-btn:active {
    transform: scale(0.92);
}

.header-btn.btn-add {
    background: var(--accent);
    border: none;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
    font-size: 18px;
}

/* Category & Tag Filter Bar */
.filter-bar {
    position: absolute;
    top: calc(var(--safe-top) + 54px);
    left: 0;
    right: 0;
    z-index: 45;
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    background: rgba(9, 11, 16, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.tag-chip {
    padding: 6px 13px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-chip.active {
    background: #ffffff;
    color: #0b0d13;
    border-color: #ffffff;
    font-weight: 700;
}

/* ==========================================================================
   Twitter (X) Style Timeline Viewport
   ========================================================================== */
.timeline-viewport {
    width: 100%;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(var(--safe-top) + 104px) 14px calc(var(--safe-bottom) + 30px);
    display: none;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.timeline-viewport.active {
    display: flex;
}

.shorts-viewport.hidden {
    display: none;
}

/* Twitter Compose Box */
.tweet-compose-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
    transition: border-color 0.2s;
}

.tweet-compose-box:focus-within {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.compose-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.compose-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.compose-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.45;
    resize: none;
    outline: none;
    min-height: 44px;
    padding: 2px 0 8px;
}

.compose-textarea::placeholder {
    color: var(--text-dim);
}

.quick-preview-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin-bottom: 10px;
}

.quick-preview-chip img {
    width: 56px;
    height: 34px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.quick-preview-info {
    flex: 1;
    overflow: hidden;
}

.quick-preview-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-preview-author {
    font-size: 11px;
    color: var(--text-muted);
}

.compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
    margin-top: 4px;
}

.compose-hint {
    font-size: 12px;
    color: var(--text-dim);
}

.btn-tweet-post {
    background: var(--accent);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
    transition: all 0.2s;
}

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

.btn-tweet-post:active {
    transform: scale(0.96);
}

.btn-tweet-post:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tweet Card */
.tweet-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s;
}

.tweet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tweet-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tweet-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.tweet-names {
    display: flex;
    flex-direction: column;
}

.tweet-author-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.tweet-meta-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

.tweet-type-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.tweet-body-text {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.45;
    margin-bottom: 10px;
    cursor: pointer;
}

.tweet-body-text:hover {
    color: var(--accent);
}

.tweet-memo-quote {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.45;
}

.tweet-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag-item {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}

/* Video Player Media Box */
.tweet-media-box {
    position: relative;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.tweet-media-box.type-shorts {
    aspect-ratio: 9 / 16;
    max-height: 520px;
    margin-left: auto;
    margin-right: auto;
}

.tweet-media-box.type-video {
    aspect-ratio: 16 / 9;
}

.tweet-yt-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Tweet Bottom Actions */
.tweet-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
    margin-top: 4px;
}

.tweet-btn-action {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    transition: all 0.2s;
}

.tweet-btn-action:hover, .tweet-btn-action:active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.tweet-btn-action.btn-fav.active {
    color: var(--heart-active);
}

.tweet-btn-action.btn-open-app {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-weight: 700;
}

.tweet-btn-action.btn-open-app:active {
    background: var(--accent);
    color: #fff;
}

/* ==========================================================================
   Shorts Fullscreen Viewport
   ========================================================================== */
.shorts-viewport {
    width: 100%;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.shorts-viewport::-webkit-scrollbar {
    display: none;
}

.shorts-card {
    width: 100%;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shorts-bg-blur {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.25);
    opacity: 0.9;
    z-index: 1;
    transform: scale(1.1);
}

.player-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-container.type-shorts {
    aspect-ratio: 9 / 16;
    max-height: 100dvh;
    width: 100%;
}

.player-container.type-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 80vh;
}

.yt-iframe-box {
    width: 100%;
    height: 100%;
    border: none;
}

.side-action-bar {
    position: absolute;
    right: 14px;
    bottom: calc(var(--safe-bottom) + 90px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.action-btn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.action-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(18, 22, 34, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-circle-btn:active {
    transform: scale(0.9);
}

.action-circle-btn.btn-favorite.active {
    color: var(--heart-active);
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.4);
}

.action-circle-btn.btn-yt-app {
    background: var(--accent);
    border: none;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.action-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.shorts-bottom-overlay {
    position: absolute;
    left: 0;
    right: 70px;
    bottom: 0;
    z-index: 20;
    padding: 16px 16px calc(var(--safe-bottom) + 16px);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 70%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.shorts-bottom-overlay > * {
    pointer-events: auto;
}

.channel-tag-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.channel-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.video-type-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.video-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.memo-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 12px;
    color: #fff;
    backdrop-filter: blur(8px);
    margin-bottom: 10px;
}

.open-yt-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    cursor: pointer;
    transition: all 0.2s;
}

.open-yt-bar:active {
    transform: scale(0.95);
}

/* Fallback Card */
.fallback-restrict-card {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(10, 12, 18, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.fallback-restrict-card img {
    width: 150px;
    height: 85px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    border: 1px solid var(--border);
}

.fallback-restrict-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.fallback-restrict-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

/* Clipboard Banner */
.clipboard-banner {
    position: fixed;
    top: calc(var(--safe-top) + 54px);
    left: 12px;
    right: 12px;
    z-index: 80;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: space-between;
}

.clipboard-banner-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.clipboard-banner-icon {
    font-size: 18px;
}

.clipboard-banner-text {
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clipboard-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-clip-add {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-clip-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

/* Empty State */
.empty-feed-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

.empty-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.modal-sheet {
    width: 100%;
    max-width: 500px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px calc(var(--safe-bottom) + 20px);
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-title {
    font-size: 17px;
    font-weight: 700;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.preview-box {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 16px;
}

.preview-thumb {
    width: 90px;
    height: 52px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.preview-meta {
    flex: 1;
    overflow: hidden;
}

.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.preview-channel {
    font-size: 11px;
    color: var(--text-muted);
}

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

.preset-tag-btn {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.preset-tag-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Toast */
.toast-msg {
    position: fixed;
    bottom: calc(var(--safe-bottom) + 24px);
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.toast-msg.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==========================================================================
   Creator Profile Header & Public Controls
   ========================================================================== */
.btn-header-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 15px;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

.btn-header-login:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45);
}

.curator-profile-card {
    background: linear-gradient(180deg, rgba(24, 29, 45, 0.95) 0%, rgba(18, 22, 34, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.curator-main-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.curator-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

.curator-header-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.curator-name {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.curator-handle {
    font-size: 13px;
    color: #60a5fa;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
}

.badge-owner {
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.curator-bio {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
    margin-top: 4px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.curator-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}

.curator-stat b {
    color: #ffffff;
    font-weight: 700;
}

.curator-stat-dot {
    color: rgba(255, 255, 255, 0.2);
}

.curator-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.btn-curator-share, .btn-curator-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.btn-curator-share {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.btn-curator-share:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
    color: #ffffff;
}

.btn-curator-edit {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.btn-curator-edit:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}
