:root {
    --bg: #f2f2f2;
    --bg-card: #fff;
    --bg-surface: #f9f9f9;
    --text: #0f0f0f;
    --text-secondary: #606060;
    --text-muted: #aaa;
    --border: rgba(0, 0, 0, .08);
    --yt-red: #FF0000;
    --font: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 200ms ease
}

.dark {
    --bg: #0f0f0f;
    --bg-card: #212121;
    --bg-surface: #181818;
    --text: #f1f1f1;
    --text-secondary: #aaa;
    --text-muted: #717171;
    --border: rgba(255, 255, 255, .08)
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,
body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased
}

.hidden {
    display: none !important
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px
}

.header h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -.01em
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font);
    font-size: .8rem;
    font-weight: 500;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition)
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--border)
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-muted)
}

.btn-secondary:disabled {
    opacity: .4;
    cursor: not-allowed
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition)
}

.btn-icon:hover {
    background: var(--bg-surface)
}

/* Main */
.main {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px
}

/* Upload Section */
.upload-section {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap
}

.upload-card {
    flex: 1;
    min-width: 200px;
    position: relative
}

.upload-label {
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .05em
}

.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    min-height: 140px
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--yt-red);
    background: rgba(255, 0, 0, .03)
}

.drop-zone p {
    font-size: .85rem;
    color: var(--text-secondary)
}

.drop-zone .hint {
    font-size: .7rem;
    color: var(--text-muted)
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer
}

.preview-thumb {
    width: 100%;
    border-radius: var(--radius);
    object-fit: cover;
    aspect-ratio: 16/9
}

.btn-clear {
    position: absolute;
    top: 32px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    font-size: .8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition)
}

.btn-clear:hover {
    background: var(--yt-red)
}

.title-input-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.title-input-group label {
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em
}

.title-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: .85rem;
    transition: border-color var(--transition);
    outline: none
}

.title-input:focus {
    border-color: var(--yt-red)
}

.title-input-sm {
    max-width: 100px
}

/* Section */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px
}

.surface-group {
    margin-bottom: 32px
}

.surface-label {
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px
}

/* YouTube Card Mockups */
.yt-card {
    background: transparent;
    max-width: 100%
}

.yt-thumb-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000
}

.yt-thumb-img {
    width: 100%;
    aspect-ratio: 16/9;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center
}

.yt-thumb-img .placeholder-text {
    color: #555;
    font-size: .8rem
}

.yt-timestamp {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, .8);
    color: #fff;
    font-size: .75rem;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1.2;
    letter-spacing: .02em
}

.yt-timestamp-sm {
    font-size: .65rem;
    padding: 1px 3px
}

/* Desktop Home Card */
.yt-card-home {
    max-width: 360px
}

.yt-thumb-home .yt-thumb-img {
    aspect-ratio: 16/9
}

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

.yt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0
}

.yt-avatar-sm {
    width: 32px;
    height: 32px
}

.yt-info {
    flex: 1;
    overflow: hidden
}

.yt-title {
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
    margin-bottom: 4px
}

.yt-title-sm {
    font-size: .8rem;
    -webkit-line-clamp: 2
}

.yt-title-mobile {
    font-size: .85rem
}

.yt-channel {
    font-size: .75rem;
    color: var(--text-secondary);
    margin-bottom: 2px
}

.yt-stats {
    font-size: .75rem;
    color: var(--text-secondary)
}

/* Sidebar Card */
.yt-card-sidebar {
    display: flex;
    gap: 8px;
    max-width: 420px
}

.yt-thumb-sidebar {
    width: 168px;
    flex-shrink: 0
}

.yt-thumb-sidebar .yt-thumb-img {
    aspect-ratio: 16/9
}

.yt-info-sidebar {
    flex: 1;
    overflow: hidden;
    padding: 2px 0
}

/* Mobile Card */
.yt-card-mobile {
    max-width: 400px
}

.yt-thumb-mobile {
    width: 100%
}

.yt-thumb-mobile .yt-thumb-img {
    aspect-ratio: 16/9
}

/* A/B mode */
.ab-active .surface-group {
    display: flex;
    gap: 16px
}

.ab-active .surface-group>* {
    flex: 1
}

.ab-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--yt-red);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2
}

/* Responsive */
@media(max-width:768px) {
    .upload-section {
        flex-direction: column
    }

    .yt-card-sidebar {
        flex-direction: column
    }

    .yt-thumb-sidebar {
        width: 100%
    }

    .main {
        padding: 16px
    }
}

@media(max-width:480px) {
    .header h1 {
        font-size: .85rem
    }

    .btn {
        padding: 6px 12px;
        font-size: .75rem
    }
}