/* ========================================
   Design Tokens (from pre-launch site)
   ======================================== */

:root {
    /* Core palette */
    --gold: #D4A853;
    --gold-light: #F0D78C;
    --gold-dark: #B8892E;
    --midnight: #0D0F14;
    --charcoal: #1A1D26;
    --slate: #2A2E3A;

    /* Text */
    --text-primary: #FAF7F2;
    --text-muted: #9CA3AF;
    --cream: #F5EFE4;

    /* Accents */
    --rose: #E8A0B4;
    --ocean: #6BA5C9;
    --sage: #8FB89A;
    --amber: #E8B86D;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-medium: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-display: 'Playfair Display', serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 20px;
    --radius-pill: 100px;
}

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

/* Base — set html background to prevent white flash before body styles load */
html {
    background-color: #0D0F14;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--midnight);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Film grain overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

main {
    flex: 1;
    padding-top: 70px; /* offset for fixed navbar */
}

/* Scroll reveal animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Navbar — Glassmorphism
   ======================================== */

.navbar {
    background: rgba(13, 15, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 168, 83, 0.08);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-brand__logo {
    height: 36px;
    width: auto;
}

.nav-brand__text {
    color: var(--text-primary);
}

.nav-brand__accent {
    color: var(--gold);
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    transition: color 0.3s, background-color 0.2s;
}

.nav-link:hover {
    color: var(--gold);
    background-color: rgba(212, 168, 83, 0.08);
}

.nav-link--primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--midnight);
}

.nav-link--primary:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--midnight);
}

/* ========================================
   Hero
   ======================================== */

.hero {
    padding: 6rem 2rem;
    text-align: center;
    background: var(--midnight);
    color: var(--text-primary);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%; left: 50%;
    transform: translateX(-50%);
    width: 800px;
    max-width: 100vw;
    height: 800px;
    background: radial-gradient(circle, rgba(212, 168, 83, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-logo {
    height: 220px;
    width: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 30px rgba(212, 168, 83, 0.25));
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
    line-height: 1.7;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-body);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn--primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--midnight);
}

.btn--primary:hover {
    box-shadow: 0 8px 30px rgba(212, 168, 83, 0.3);
}

.btn--lg {
    padding: 1rem 3rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.btn--secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn--secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: transparent;
}

.btn--danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn--danger:hover {
    background-color: rgba(239, 68, 68, 0.25);
}

.btn--danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn--danger:disabled:hover {
    background-color: rgba(239, 68, 68, 0.15);
}

.btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn--ghost:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn--danger-text {
    color: #ef4444;
}

.btn--danger-text:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* ========================================
   Footer
   ======================================== */

.footer {
    background: transparent;
    color: var(--text-muted);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   Dashboard
   ======================================== */

.dashboard {
    padding: 2rem 0;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.dashboard-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

/* ========================================
   Badges
   ======================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge--success {
    background-color: rgba(143, 184, 154, 0.15);
    color: var(--sage);
}

.badge--draft {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.badge--rendering {
    background-color: rgba(107, 165, 201, 0.15);
    color: var(--ocean);
}

.badge--complete {
    background-color: rgba(143, 184, 154, 0.15);
    color: var(--sage);
}

.badge--failed {
    background-color: rgba(232, 160, 180, 0.15);
    color: var(--rose);
}

/* ========================================
   Archive Toggle
   ======================================== */

.archive-toggle {
    display: inline-flex;
    background: var(--charcoal);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 3px;
    margin-bottom: 1.5rem;
}

.archive-toggle__btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 1rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.archive-toggle__btn:hover {
    color: var(--text-primary);
}

.archive-toggle__btn.active {
    background: var(--gold);
    color: var(--midnight);
    font-weight: 600;
}

/* ========================================
   Project Grid & Cards
   ======================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.project-card {
    background: var(--charcoal);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s;
}

.project-card:hover {
    border-color: rgba(212, 168, 83, 0.2);
    transform: translateY(-2px);
}

.project-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.project-card__name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 0.5rem;
}

.project-card__description {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
    min-height: 2.45rem;
}

.project-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.project-card__photos {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.project-card__actions {
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}

.project-card--archived {
    opacity: 0.7;
}

.project-card--archived:hover {
    opacity: 0.85;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state__icon {
    font-size: 4rem;
    color: var(--slate);
    margin-bottom: 1rem;
}

.empty-state__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.empty-state__text {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s, color 0.15s;
    z-index: 1;
}

.modal__close:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.modal__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.modal__body {
    margin-bottom: 0.5rem;
}

.modal__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.modal__input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--slate);
    transition: border-color 0.2s;
    margin-bottom: 1rem;
    font-family: var(--font-body);
}

.modal__input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.modal__textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--slate);
    height: 80px;
    resize: vertical;
    transition: border-color 0.2s;
    font-family: var(--font-body);
}

.modal__textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.modal__error {
    color: var(--rose);
    font-size: 0.8125rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.modal__warning {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

.modal__actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ========================================
   Project Detail Page
   ======================================== */

.project-detail {
    padding: 2rem 0;
}

.project-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-header__left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-header__back {
    color: var(--gold);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-header__back:hover {
    text-decoration: underline;
}

.project-header__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.project-header__description {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

/* ========================================
   Upload Dropzone
   ======================================== */

.upload-section {
    margin-bottom: 1.5rem;
}

.upload-dropzone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-dropzone:hover {
    border-color: var(--gold);
    background-color: rgba(212, 168, 83, 0.03);
}

.upload-dropzone.dragover {
    border-color: var(--gold);
    background-color: rgba(212, 168, 83, 0.05);
    border-style: solid;
}

.upload-dropzone__icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.upload-dropzone__text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.upload-dropzone__subtext {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.upload-dropzone__formats {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Upload stats */
.upload-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.upload-stats__bar {
    flex: 1;
    height: 6px;
    background: var(--slate);
    border-radius: 3px;
    overflow: hidden;
}

.upload-stats__progress {
    height: 100%;
    background: var(--gold);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.upload-stats--done {
    opacity: 0.6;
    transition: opacity 1.5s ease 0.5s;
}

.upload-stats--done .upload-stats__progress {
    background: var(--sage);
}

/* Upload queue — only used for error items now */
.upload-queue {
    margin-bottom: 1.5rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.upload-item__name {
    font-size: 0.8125rem;
    color: var(--text-muted);
    min-width: 150px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item__progress-bar {
    flex: 1;
    height: 8px;
    background: var(--slate);
    border-radius: 4px;
    overflow: hidden;
}

.upload-item__progress {
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
    transition: width 0.2s ease;
}

.upload-item__progress--complete {
    background: var(--sage);
}

.upload-item__progress--error {
    background: #ef4444;
}

.upload-item__status {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

.upload-item__status--uploading {
    color: var(--gold);
}

.upload-item__status--complete {
    color: var(--sage);
}

.upload-item__status--error {
    color: #ef4444;
}

.upload-item__status--warning {
    color: var(--amber);
}

.upload-item--warning {
    background: rgba(232, 184, 109, 0.1);
    border-left: 3px solid var(--amber);
}

.nsfw-warning {
    color: var(--amber);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.moderation-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(232, 184, 109, 0.9);
    color: var(--midnight);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ========================================
   Photo Grid
   ======================================== */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
}

.photo-grid__item {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--slate);
    position: relative;
    cursor: grab;
    transition: opacity 0.2s, filter 0.2s, box-shadow 0.2s;
}

.photo-grid__item:active {
    cursor: grabbing;
}

.photo-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* SortableJS ghost */
.photo-grid__item--ghost {
    opacity: 0.4;
    box-shadow: 0 0 0 2px var(--gold);
    transform: scale(0.95);
}

/* Excluded photo */
.photo-grid__item--excluded {
    opacity: 0.4;
    filter: grayscale(0.7);
}

/* Selected photo */
.photo-grid__item--selected {
    box-shadow: 0 0 0 3px var(--gold);
}

/* Overlay (visible on hover) */
.photo-grid__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.photo-grid__item:hover .photo-grid__overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Position badge */
.photo-grid__position {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    pointer-events: none;
}

/* Include/exclude toggle button */
.photo-grid__toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    background: rgba(143, 184, 154, 0.85);
    color: #fff;
    border: none;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.2s, opacity 0.2s;
    opacity: 0.75;
    letter-spacing: 0.5px;
}

.photo-grid__toggle:hover {
    opacity: 1;
}

.photo-grid__toggle--off {
    background: rgba(232, 160, 180, 0.85);
}

/* Selection checkbox — hidden until hover or checked.
   Placed directly on the grid item (not inside the overlay)
   so pointer-events always work, including on touch. */
.photo-grid__select {
    position: absolute;
    bottom: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    pointer-events: auto;
    accent-color: var(--gold);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.15s;
}

.photo-grid__item:hover .photo-grid__select,
.photo-grid__select:checked {
    opacity: 1;
}

/* Excluded label overlay */
.photo-grid__excluded-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    text-align: center;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 3px 0;
}

/* Bulk action bar */
.bulk-action-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    font-size: 0.875rem;
    transition: opacity 0.2s, transform 0.2s;
}

.bulk-action-bar.hidden {
    display: none;
}

/* ========================================
   Photo Detail Modal
   ======================================== */

.photo-detail-modal {
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.photo-detail-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s, color 0.15s;
    z-index: 1;
}

.photo-detail-modal__close:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.photo-detail-modal__image-wrap {
    margin-bottom: 20px;
    background: var(--slate);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.photo-detail-modal__image-wrap img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

.photo-detail-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.photo-detail-modal__filename {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    margin-right: 12px;
}

.photo-detail-modal__toggle-btn {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s;
}

.photo-detail-modal__toggle-btn--included {
    background: rgba(143, 184, 154, 0.15);
    color: var(--sage);
}

.photo-detail-modal__toggle-btn--included:hover {
    background: rgba(143, 184, 154, 0.25);
}

.photo-detail-modal__toggle-btn--excluded {
    background: rgba(232, 160, 180, 0.15);
    color: var(--rose);
}

.photo-detail-modal__toggle-btn--excluded:hover {
    background: rgba(232, 160, 180, 0.25);
}

.photo-detail-modal__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.photo-detail-modal__section h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.photo-detail-modal__row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-subtle);
}

.photo-detail-modal__row:last-child {
    border-bottom: none;
}

.photo-detail-modal__label {
    color: var(--text-muted);
}

.photo-detail-modal__value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

.photo-detail-modal__value--break {
    word-break: break-all;
    max-width: 60%;
}

/* Quality score badges */
.quality-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.quality-high {
    background: rgba(143, 184, 154, 0.15);
    color: var(--sage);
}

.quality-medium {
    background: rgba(232, 176, 109, 0.15);
    color: var(--amber);
}

.quality-low {
    background: rgba(232, 160, 180, 0.15);
    color: var(--rose);
}

@media (max-width: 600px) {
    .photo-detail-modal {
        padding: 16px;
    }

    .photo-detail-modal__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .photo-detail-modal__image-wrap img {
        max-height: 280px;
    }
}

/* Back link */
.back-link {
    display: inline-block;
    color: var(--gold);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* Project detail header */
.project-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.project-detail-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 0.75rem;
    display: inline;
}

.project-detail-description {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 2rem;
    margin-top: 0.5rem;
}

/* ========================================
   Music Section
   ======================================== */

.music-section {
    margin-top: 2rem;
}

.music-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.music-section__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Upload button as label */
.upload-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--midnight);
    cursor: pointer;
}

.upload-btn:hover {
    box-shadow: 0 4px 12px rgba(212, 168, 83, 0.3);
}

/* Upload progress */
.upload-progress {
    margin-bottom: 1rem;
    background: var(--charcoal);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid var(--border-subtle);
}

.upload-progress__bar {
    height: 8px;
    background: var(--slate);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.upload-progress__fill {
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
    transition: width 0.2s ease;
    width: 0%;
}

.upload-progress__text {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Music error */
.music-error {
    background: rgba(232, 160, 180, 0.1);
    color: var(--rose);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(232, 160, 180, 0.2);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Music loading */
.music-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Music dropzone */
.upload-dropzone--music {
    margin-bottom: 1rem;
}

.upload-dropzone--compact {
    flex-direction: row;
    padding: 1rem 1.5rem;
    margin-top: 0.75rem;
    gap: 0.75rem;
    min-height: 0;
}

.upload-dropzone--compact .upload-dropzone__icon {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.upload-dropzone--compact .upload-dropzone__text {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0;
    color: var(--text-muted);
}

/* ========================================
   Song List & Cards
   ======================================== */

.song-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.song-card {
    background: var(--charcoal);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s, opacity 0.2s;
}

.song-card:hover {
    border-color: var(--border-medium);
}

.song-card--dragging {
    opacity: 0.4;
}

.song-card--drag-over {
    box-shadow: 0 0 0 2px var(--gold);
}

/* Drag handle */
.song-card__drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
}

.song-card__drag-handle:active {
    cursor: grabbing;
}

.drag-icon {
    display: block;
}

/* Song info */
.song-card__info {
    flex: 1;
    min-width: 0;
}

.song-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.song-card__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.song-card__meta-item {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Song controls */
.song-card__controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Play button active state */
.song-play-btn--active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--midnight) !important;
}

.song-play-btn--active:hover {
    box-shadow: 0 4px 12px rgba(212, 168, 83, 0.3);
}

/* Click track button active state */
.song-click-btn--active {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--midnight) !important;
}

.song-click-btn--active:hover {
    box-shadow: 0 4px 12px rgba(212, 168, 83, 0.3);
}

/* Analyzing badge */
.badge--analyzing {
    background-color: rgba(232, 176, 109, 0.15);
    color: var(--amber);
}

/* Project card clickable name */
.project-card__name-link {
    color: inherit;
    text-decoration: none;
}

.project-card__name-link:hover {
    color: var(--gold);
}

/* ========================================
   Hamburger Menu
   ======================================== */

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
}

.nav-hamburger__line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger.is-active .nav-hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.is-active .nav-hamburger__line:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.is-active .nav-hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   Render Section
   ======================================== */

.render-section {
    margin-top: 2rem;
}

.render-section__header {
    margin-bottom: 1rem;
}

.render-section__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.render-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.render-progress {
    margin-bottom: 1rem;
}

.render-progress__bar {
    height: 8px;
    background: var(--slate);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.render-progress__fill {
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.render-progress__text {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.render-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.share-link-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.share-link-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--slate);
    font-family: var(--font-body);
}

.render-history {
    margin-top: 1.5rem;
}

/* ========================================
   Template Picker
   ======================================== */

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

.template-card {
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--charcoal);
}

.template-card:hover {
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.15);
}

.template-card--selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.2);
}

.template-card__swatch {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.template-card__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.template-card__desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Info Button */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--text-muted);
    background: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 6px;
    padding: 0;
    line-height: 1;
    transition: border-color 0.2s, color 0.2s;
}
.info-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Template Info Table */
.template-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.template-info-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 8px;
    border-bottom: 2px solid var(--border-medium);
    white-space: nowrap;
}
.template-info-table td {
    padding: 8px 8px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    white-space: nowrap;
}
.template-info-table tbody tr:last-child td {
    border-bottom: none;
}
.template-info-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.template-info-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--slate);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Quality Scoring Info */
.quality-info-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}
.quality-info-section:last-child { border-bottom: none; }
.quality-info-heading {
    font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
    margin-bottom: 4px;
}
.quality-info-text {
    font-size: 0.8rem; color: var(--text-muted); line-height: 1.5;
    margin: 0;
}
.quality-info-scale {
    display: flex; gap: 8px; margin-top: 8px;
}
.quality-badge {
    display: inline-block; font-size: 0.7rem; font-weight: 600;
    padding: 2px 8px; border-radius: var(--radius-sm);
}
.quality-low { background: rgba(232, 160, 180, 0.15); color: var(--rose); }
.quality-medium { background: rgba(232, 183, 109, 0.15); color: var(--amber); }
.quality-high { background: rgba(143, 184, 154, 0.15); color: var(--sage); }

/* Aspect Ratio Picker */
.aspect-ratio-picker {
    display: flex;
    gap: 12px;
}

.aspect-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--charcoal);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.aspect-btn:hover {
    border-color: var(--gold);
}

.aspect-btn--selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.2);
}

.aspect-preview {
    display: block;
    background: var(--gold);
    border-radius: 3px;
}

.aspect-preview--landscape {
    width: 48px;
    height: 27px;
}

.aspect-preview--portrait {
    width: 27px;
    height: 48px;
}

.aspect-preview--square {
    width: 36px;
    height: 36px;
}

.aspect-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Mobile upload buttons (visible only on mobile) */
.mobile-upload-actions {
    display: none;
}

/* ========================================
   Toast / Notification
   ======================================== */

.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
}

/* Beats per Photo Picker */
.beats-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.beats-picker input[type="range"] {
    flex: 1;
    min-width: 140px;
    max-width: 280px;
    accent-color: var(--gold);
}

.beats-picker__value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gold);
    min-width: 60px;
}

.beats-picker .help-text {
    flex-basis: 100%;
    margin-top: 4px;
}

/* Logo Section */
.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logo-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--slate);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.logo-preview img {
    max-height: 48px;
    max-width: 120px;
    object-fit: contain;
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Text Overlay Controls */
.photo-overlay-control {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.overlay-badge {
    font-size: 0.65rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overlay-edit-btn {
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
    min-width: auto !important;
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer;
    margin-left: auto;
}

.overlay-edit-btn:hover {
    background: rgba(0, 0, 0, 0.8) !important;
}

.overlay-input {
    width: 100%;
    font-size: 0.75rem;
    padding: 4px 8px;
    border: 1px solid var(--gold);
    border-radius: 4px;
    outline: none;
    background: var(--slate);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.btn--xs {
    font-size: 0.7rem;
    padding: 2px 8px;
}

/* ========================================
   Billing & Pricing
   ======================================== */

.billing-page { padding: 40px 20px; }
.billing-container { max-width: 1000px; margin: 0 auto; }
.billing-title {
    text-align: center; font-size: 2rem; margin-bottom: 8px;
    font-family: var(--font-display); color: var(--text-primary);
}
.billing-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 32px; }

.current-plan-banner {
    background: rgba(212, 168, 83, 0.08); border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: var(--radius-md); padding: 12px 20px; margin-bottom: 24px;
    text-align: center; color: var(--text-primary);
}

.pricing-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 24px; margin-bottom: 40px;
}
@media (max-width: 768px) {
    .pricing-grid { grid-template-columns: 1fr; }
}

.pricing-card {
    background: var(--charcoal); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); padding: 32px 24px; text-align: center;
    position: relative; display: flex; flex-direction: column;
    transition: transform 0.3s, border-color 0.3s;
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card--featured {
    border-color: rgba(212, 168, 83, 0.3);
    background: linear-gradient(135deg, var(--charcoal), rgba(212, 168, 83, 0.05));
}
.pricing-card--current { border-color: var(--sage); }

.pricing-card__badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--gold); color: var(--midnight); padding: 4px 16px;
    border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
}

.pricing-card__header { margin-bottom: 24px; }
.pricing-card__name { font-size: 1.25rem; margin-bottom: 8px; color: var(--text-primary); }
.pricing-card__amount {
    font-family: var(--font-display); font-size: 2.5rem; font-weight: 700;
    color: var(--text-primary);
}
.pricing-card__period { color: var(--text-muted); font-size: 0.875rem; }
.pricing-card__note { color: var(--text-muted); font-size: 0.8rem; margin-top: 4px; }

.pricing-card__features {
    list-style: none; padding: 0; margin: 0 0 24px; text-align: left; flex-grow: 1;
}
.pricing-card__features li {
    padding: 8px 0; border-bottom: 1px solid var(--border-subtle);
    padding-left: 24px; position: relative; color: var(--text-muted);
}
.pricing-card__features li::before {
    content: '\2713'; position: absolute; left: 0; color: var(--gold); font-weight: 700;
}
.pricing-card__feature--highlight { font-weight: 600; color: var(--text-primary); }

.pricing-card__btn { width: 100%; }

.subscription-management {
    background: var(--charcoal); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); padding: 24px; text-align: center;
    color: var(--text-primary);
}

/* Tier badges */
.tier-badge {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
}
.tier-badge--free { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }
.tier-badge--premium { background: rgba(107, 165, 201, 0.15); color: var(--ocean); }
.tier-badge--pro { background: rgba(232, 176, 109, 0.15); color: var(--amber); }
.tier-badge--past_due { background: rgba(232, 160, 180, 0.15); color: var(--rose); }

/* Upgrade prompt */
.upgrade-prompt {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.12), rgba(212, 168, 83, 0.04));
    border: 1px solid rgba(212, 168, 83, 0.2);
    color: var(--text-primary); border-radius: var(--radius-md); padding: 16px 20px;
    margin: 16px 0; display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
}
.upgrade-prompt__text { font-size: 0.9rem; }
.upgrade-prompt__btn {
    background: var(--gold); color: var(--midnight); border: none; padding: 8px 16px;
    border-radius: var(--radius-pill); font-weight: 600; cursor: pointer; white-space: nowrap;
    text-decoration: none;
}
.upgrade-prompt__btn:hover { background: var(--gold-light); }

/* ========================================
   Collection Section
   ======================================== */

.collection-section {
    margin: 24px 0;
    background: var(--charcoal);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}
.collection-section[open] > .cloud-sources-toggle::after {
    transform: rotate(180deg);
}
.collection-section[open] > .cloud-sources-toggle {
    padding-bottom: 8px;
}
.collection-section > :not(summary) {
    padding: 0 20px;
}
.collection-section > :last-child {
    padding-bottom: 20px;
}
.collection-description {
    color: var(--text-muted); font-size: 0.9rem; margin: 0 0 16px;
}
#collection-generate-btn {
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    margin-left: 20px;
    margin-bottom: 20px;
}
.collection-link-display { margin-top: 16px; }
.collection-link-row {
    display: flex; gap: 24px; align-items: flex-start;
}
.qr-code-display {
    flex-shrink: 0; border-radius: var(--radius-md); overflow: hidden;
    border: 1px solid var(--border-subtle); background: #fff;
}
.qr-code-display img { display: block; width: 200px; height: 200px; }
.qr-download-actions {
    display: flex; gap: 6px; padding: 8px;
}
.qr-download-actions .btn { font-size: 0.7rem; padding: 5px 8px; text-decoration: none; text-align: center; flex: 1; }
.collection-link-info {
    flex: 1; display: flex; flex-direction: column; gap: 12px;
}
.collection-url-field-wrap {
    display: flex; gap: 8px; align-items: center;
}
.collection-url-field {
    flex: 1; padding: 8px 12px; border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm); font-size: 0.875rem; background: var(--slate);
    color: var(--text-muted); font-family: var(--font-body);
}
.collection-submission-badge {
    display: inline-block; padding: 4px 12px; border-radius: 12px;
    background: rgba(107, 165, 201, 0.15); color: var(--ocean);
    font-size: 0.8rem; font-weight: 600; width: fit-content;
}

/* Pending submissions */
.subsection-title {
    font-size: 1.1rem; margin: 20px 0 12px; color: var(--text-primary);
}
.submissions-bulk-actions {
    display: flex; gap: 8px; margin-bottom: 12px;
}
.submissions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.submission-card {
    position: relative; border-radius: var(--radius-md); overflow: hidden;
    border: 1px solid var(--border-subtle); background: var(--slate);
    transition: opacity 0.2s;
}
.submission-card--processing { opacity: 0.4; pointer-events: none; }
.submission-card__img-wrap {
    aspect-ratio: 1 / 1; overflow: hidden; background: var(--charcoal);
}
.submission-card__img-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.submission-actions {
    display: flex; gap: 4px; padding: 6px; justify-content: center;
}
.submission-btn {
    border: none; border-radius: var(--radius-sm); padding: 6px 14px;
    cursor: pointer; font-size: 1rem; font-weight: 600; transition: background 0.15s;
}
.submission-btn--approve {
    background: rgba(143, 184, 154, 0.15); color: var(--sage);
}
.submission-btn--approve:hover { background: rgba(143, 184, 154, 0.25); }
.submission-btn--reject {
    background: rgba(232, 160, 180, 0.15); color: var(--rose);
}
.submission-btn--reject:hover { background: rgba(232, 160, 180, 0.25); }

.submissions-empty {
    color: var(--text-muted); font-size: 0.9rem; text-align: center; padding: 24px 0;
}

/* Flagged photo review queue */
.flagged-auto-exclude {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 12px;
}
.flagged-auto-exclude input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
}
.flagged-section {
    margin-bottom: 16px;
}
.flagged-banner {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 14px;
    background: rgba(232, 183, 109, 0.08);
    border: 1px solid rgba(232, 183, 109, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer; color: var(--amber);
    font-size: 0.875rem; font-weight: 600;
    transition: background 0.15s;
}
.flagged-banner:hover { background: rgba(232, 183, 109, 0.12); }
.flagged-banner__icon { font-size: 1rem; }
.flagged-banner__text { flex: 1; text-align: left; }
.flagged-banner__arrow {
    font-size: 0.65rem; transition: transform 0.2s;
}
.flagged-banner__arrow--open { transform: rotate(180deg); }
.flagged-panel {
    margin-top: 10px;
    padding: 12px;
    background: var(--charcoal);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.flagged-bulk-actions {
    display: flex; gap: 8px; margin-bottom: 12px;
}
.flagged-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.flagged-card {
    position: relative; border-radius: var(--radius-md); overflow: hidden;
    border: 1px solid var(--border-subtle); background: var(--slate);
    transition: opacity 0.2s;
}
.flagged-card--processing { opacity: 0.4; pointer-events: none; }
.flagged-card__img-wrap {
    aspect-ratio: 1 / 1; overflow: hidden; background: var(--charcoal);
}
.flagged-card__img-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.flagged-card__reason {
    padding: 6px 8px; font-size: 0.7rem; color: var(--amber);
    background: rgba(232, 183, 109, 0.06);
    line-height: 1.3;
    min-height: 32px;
}
.flagged-card__actions {
    display: flex; gap: 4px; padding: 6px; justify-content: center;
}
.flagged-btn {
    border: none; border-radius: var(--radius-sm); padding: 4px 10px;
    cursor: pointer; font-size: 0.75rem; font-weight: 600; transition: background 0.15s;
}
.flagged-btn--dismiss {
    background: rgba(107, 165, 201, 0.15); color: var(--ocean);
}
.flagged-btn--dismiss:hover { background: rgba(107, 165, 201, 0.25); }
.flagged-btn--exclude {
    background: rgba(232, 183, 109, 0.15); color: var(--amber);
}
.flagged-btn--exclude:hover { background: rgba(232, 183, 109, 0.25); }
.flagged-btn--delete {
    background: rgba(232, 160, 180, 0.15); color: var(--rose);
}
.flagged-btn--delete:hover { background: rgba(232, 160, 180, 0.25); }

/* Collection toast */
.collection-toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--charcoal); border: 1px solid var(--border-medium);
    color: var(--text-primary); padding: 10px 20px; border-radius: var(--radius-md);
    font-size: 0.875rem; z-index: 9999; opacity: 0;
    transition: opacity 0.3s;
}
.collection-toast--visible { opacity: 1; }

/* Responsive: tablet */
@media (max-width: 768px) {
    .collection-link-row { flex-direction: column; align-items: center; }
    .submissions-grid { grid-template-columns: repeat(2, 1fr); }
    .flagged-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========================================
   White-Label Branding Section
   ======================================== */

.branding-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--charcoal);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.branding-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.branding-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.branding-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.branding-input {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--slate);
    max-width: 360px;
    transition: border-color 0.2s;
    font-family: var(--font-body);
}

.branding-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.branding-color-picker {
    width: 40px;
    height: 36px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
}

.branding-color-text {
    width: 90px;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: monospace;
    color: var(--text-primary);
    background: var(--slate);
}

.branding-color-text:focus {
    outline: none;
    border-color: var(--gold);
}

.branding-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
    cursor: pointer;
}

.branding-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
}

.branding-preview {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(212, 168, 83, 0.08);
    border: 1px solid rgba(212, 168, 83, 0.15);
    border-radius: var(--radius-md);
}

.branding-preview .help-text {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ========================================
   Project Sidebar & Tabs
   ======================================== */

.project-layout {
    display: flex;
    gap: 0;
    min-height: 60vh;
}

.project-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    border-right: 1px solid var(--border-subtle);
    padding-right: 0;
}

.project-sidebar__nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background-color 0.15s, color 0.15s;
    position: relative;
}

.project-sidebar__link:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.project-sidebar__link.active {
    background-color: rgba(212, 168, 83, 0.08);
    color: var(--gold);
    font-weight: 600;
}

.project-sidebar__link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
}

.project-sidebar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    font-size: 1rem;
    flex-shrink: 0;
}

.project-sidebar__link.active .project-sidebar__icon {
    background: rgba(212, 168, 83, 0.15);
}

.project-content {
    flex: 1;
    min-width: 0;
    padding-left: 1.5rem;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Reset top margins on sections when inside tab panels */
.tab-panel .music-section {
    margin-top: 0;
}

.tab-panel .render-section {
    margin-top: 0;
}

.tab-panel .customize-section {
    margin-top: 0;
}

.tab-panel .collection-section {
    margin-top: 0;
}

.tab-panel .branding-section {
    margin-top: 0;
}

.tab-panel .upgrade-prompt {
    margin-bottom: 1rem;
}

/* ========================================
   Customize Section
   ======================================== */

.customize-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--charcoal);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* ========================================
   Responsive: Tablet (max-width: 1024px)
   ======================================== */

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   Responsive: Mobile (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    /* --- Hamburger nav --- */
    .nav-hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--charcoal);
        flex-direction: column;
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--border-subtle);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        z-index: 1000;
    }

    .nav-links.is-open {
        display: flex;
    }

    .navbar {
        /* keep fixed positioning on mobile too */
    }

    .nav-container {
        padding: 0 1rem;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* --- Container padding reduction --- */
    .dashboard-container,
    .project-detail-container,
    .footer-container {
        padding: 0 1rem;
    }

    /* --- Hero --- */
    .hero {
        padding: 3rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.0625rem;
    }

    .hero .btn--lg {
        display: block;
        width: 100%;
        text-align: center;
    }

    /* --- Dashboard --- */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-header .btn--primary {
        width: 100%;
        text-align: center;
    }

    /* --- Project detail header --- */
    .project-header,
    .project-detail-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* --- Upload dropzone --- */
    .upload-dropzone {
        padding: 2rem 1rem;
        min-height: 150px;
    }

    .upload-dropzone__text {
        font-size: 1rem;
    }

    .upload-dropzone__icon {
        font-size: 2.5rem;
    }

    /* Hide drag-and-drop text on mobile */
    .upload-dropzone__text,
    .upload-dropzone__subtext {
        display: none;
    }

    /* Show mobile upload buttons */
    .mobile-upload-actions {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        max-width: 280px;
    }

    .mobile-upload-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        min-height: 48px;
        padding: 0.75rem 1.5rem;
        border-radius: var(--radius-md);
        border: none;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        width: 100%;
        font-family: var(--font-body);
    }

    .mobile-upload-btn--camera {
        background: linear-gradient(135deg, var(--gold), var(--gold-dark));
        color: var(--midnight);
    }

    .mobile-upload-btn--browse {
        background: var(--slate);
        color: var(--text-muted);
    }

    /* --- Photo grid --- */
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .photo-grid__overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .photo-grid__toggle {
        min-width: 44px;
        min-height: 32px;
        font-size: 0.6875rem;
        padding: 6px 10px;
    }

    .photo-grid__select {
        width: 24px;
        height: 24px;
    }

    /* --- Song list --- */
    .song-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .song-card__controls {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        border-top: 1px solid var(--border-subtle);
        padding-top: 0.75rem;
        margin-top: 0.25rem;
    }

    .song-card__drag-handle {
        display: none;
    }

    .music-section__header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .music-section__header .upload-btn {
        width: 100%;
        text-align: center;
    }

    /* --- Render controls --- */
    .render-controls {
        flex-direction: column;
    }

    .render-controls .btn {
        width: 100%;
        text-align: center;
    }

    .render-progress {
        width: 100%;
    }

    .render-actions {
        flex-direction: column;
    }

    .render-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* --- Share link --- */
    .share-link-display {
        flex-direction: column;
    }

    .share-link-display .btn {
        width: 100%;
        text-align: center;
    }

    .share-link-input {
        width: 100%;
    }

    /* --- Bulk action bar --- */
    .bulk-action-bar {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        transform: none;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }

    .bulk-action-bar .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* --- Modal --- */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal__actions {
        flex-direction: column-reverse;
    }

    .modal__actions .btn {
        width: 100%;
        text-align: center;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* --- Template grid --- */
    .template-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 8px;
    }

    .template-card {
        scroll-snap-align: start;
        min-width: 140px;
        flex-shrink: 0;
    }

    /* --- Aspect ratio picker --- */
    .aspect-ratio-picker {
        justify-content: stretch;
    }

    .aspect-ratio-btn,
    .aspect-btn {
        flex: 1;
        min-height: 48px;
    }

    /* --- Toast on mobile --- */
    .toast {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    /* --- Video player --- */
    #preview-video {
        width: 100%;
        height: auto;
    }

    /* --- Upload queue items --- */
    .upload-item__name {
        min-width: 80px;
        max-width: 120px;
        font-size: 0.75rem;
    }

    /* --- Empty state --- */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state__icon {
        font-size: 3rem;
    }

    .empty-state__title {
        font-size: 1.25rem;
    }

    /* --- General touch target enforcement --- */
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn--sm {
        min-height: 44px;
    }

    .btn--ghost {
        min-height: 44px;
    }

    /* --- Sidebar to horizontal tabs --- */
    .project-layout {
        flex-direction: column;
    }

    .project-sidebar {
        width: 100%;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        padding-right: 0;
        padding-bottom: 0;
        margin-bottom: 1rem;
    }

    .project-sidebar__nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .project-sidebar__nav::-webkit-scrollbar {
        display: none;
    }

    .project-sidebar__nav li {
        flex-shrink: 0;
    }

    .project-sidebar__link {
        padding: 10px 16px;
        border-radius: 0;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
    }

    .project-sidebar__link.active {
        background-color: transparent;
        border-bottom-color: var(--gold);
    }

    .project-sidebar__link.active::before {
        display: none;
    }

    .project-content {
        padding-left: 0;
    }
}

/* ========================================
   Responsive: Small phones (max-width: 480px)
   ======================================== */

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.625rem;
    }

    .hero-subtitle {
        font-size: 0.9375rem;
    }

    .hero {
        padding: 2rem 0.75rem;
    }

    .dashboard-container,
    .project-detail-container {
        padding: 0 0.75rem;
    }

    .photo-grid {
        gap: 6px;
    }

    .project-detail-title {
        font-size: 1.375rem;
    }

    .dashboard-title {
        font-size: 1.375rem;
    }

    .upload-dropzone {
        padding: 1.5rem 0.75rem;
    }

    .modal {
        padding: 1.25rem;
    }

    .submissions-grid { grid-template-columns: 1fr; }
    .flagged-grid { grid-template-columns: 1fr; }
    .collection-url-field-wrap { flex-direction: column; }
}

/* ========================================
   Upgrade Required Page (403 tier gate)
   ======================================== */

.upgrade-page {
    padding: 60px 20px;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upgrade-page__container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.upgrade-page__header {
    margin-bottom: 40px;
}

.upgrade-page__icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.upgrade-page__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.upgrade-page__subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.upgrade-page__pricing {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
    text-align: left;
}

.upgrade-page__footer {
    margin-top: 20px;
}

@media (max-width: 600px) {
    .upgrade-page { padding: 40px 16px; }
    .upgrade-page__title { font-size: 1.5rem; }
    .upgrade-page__pricing { grid-template-columns: 1fr; }
}

/* ========================================
   Cloud Sources (Pro-only)
   ======================================== */

.cloud-sources-section {
    margin: 24px 0;
    background: var(--charcoal);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.cloud-sources-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    list-style: none;
    user-select: none;
}

.cloud-sources-toggle::-webkit-details-marker { display: none; }

.cloud-sources-toggle::after {
    content: '\25BC';
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.cloud-sources-section[open] > .cloud-sources-toggle::after {
    transform: rotate(180deg);
}

.cloud-sources-section[open] > .cloud-sources-toggle {
    padding-bottom: 8px;
}

.cloud-sources-section > :not(summary) {
    padding: 0 20px;
}

.cloud-sources-section > :last-child {
    padding-bottom: 20px;
}

.cloud-sources-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

/* Provider buttons */
.cloud-provider-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.cloud-provider-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--slate);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    min-width: 240px;
    flex: 1;
    max-width: 360px;
}

.cloud-provider-btn--connected {
    border-color: var(--sage);
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.cloud-provider-btn__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cloud-provider-btn__name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.cloud-provider-btn__email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cloud-provider-btn__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Syncs list */
.cloud-syncs-list {
    margin-top: 16px;
}

.cloud-sync-card {
    background: var(--slate);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.cloud-sync-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.cloud-sync-card__folder {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: block;
}

.cloud-sync-card__provider {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.cloud-sync-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cloud-sync-status--active { background: rgba(76, 175, 80, 0.2); color: #66bb6a; }
.cloud-sync-status--syncing { background: rgba(33, 150, 243, 0.2); color: #42a5f5; }
.cloud-sync-status--pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.cloud-sync-status--error { background: rgba(244, 67, 54, 0.2); color: #ef5350; }
.cloud-sync-status--paused { background: rgba(158, 158, 158, 0.2); color: #9e9e9e; }
.cloud-sync-status--disconnected { background: rgba(158, 158, 158, 0.2); color: #9e9e9e; }

.cloud-sync-card__meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cloud-sync-card__actions {
    display: flex;
    gap: 8px;
}

.cloud-sync-error {
    font-size: 0.8rem;
    color: #ef5350;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: var(--radius-sm);
}

/* Progress bar */
.cloud-sync-progress {
    height: 4px;
    background: var(--charcoal);
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}

.cloud-sync-progress__bar {
    height: 100%;
    background: var(--gold);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Folder browser */
.cloud-folder-tree {
    max-height: 400px;
    overflow-y: auto;
    padding: 4px 0;
}

.cloud-folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.cloud-folder-item:hover {
    background: var(--slate);
}

.cloud-folder-item--selected {
    background: rgba(212, 168, 83, 0.15);
    border: 1px solid var(--gold);
}

.cloud-folder-item__icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cloud-folder-item__name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.cloud-folder-item__expand {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.cloud-folder-item__expand:hover {
    background: var(--charcoal);
    color: var(--text-primary);
}

.cloud-folder-loading,
.cloud-folder-empty,
.cloud-folder-error {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.cloud-folder-error {
    color: #ef5350;
}

@media (max-width: 600px) {
    .cloud-provider-list { flex-direction: column; }
    .cloud-provider-btn { max-width: 100%; }
    .cloud-sync-card__meta { flex-direction: column; gap: 4px; }
}

/* ========================================
   Legal Pages
   ======================================== */

.legal-page {
    padding: 60px 20px 80px;
    max-width: 800px;
    margin: 0 auto;
}

.legal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.legal-updated {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 32px;
}

.legal-content h2 {
    color: var(--gold);
    font-size: 1.2rem;
    margin-top: 32px;
    margin-bottom: 12px;
    font-family: var(--font-display);
}

.legal-content h3 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-top: 20px;
    margin-bottom: 8px;
}

.legal-content p,
.legal-content li {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-content ul,
.legal-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.legal-content a {
    color: var(--gold);
    text-decoration: underline;
}

.legal-content a:hover {
    color: var(--gold-light);
}

.legal-contact-block {
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
}

.legal-contact-block p {
    margin-bottom: 4px;
}

/* DMCA Forms */

.dmca-form {
    margin-top: 24px;
}

.dmca-form-group {
    margin-bottom: 20px;
}

.dmca-form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.dmca-form-group input[type="text"],
.dmca-form-group input[type="email"],
.dmca-form-group input[type="tel"],
.dmca-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}

.dmca-form-group input:focus,
.dmca-form-group textarea:focus {
    border-color: var(--gold);
    outline: none;
}

.dmca-form-group textarea {
    resize: vertical;
}

.dmca-form-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.dmca-checkbox-group label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    line-height: 1.5;
}

.dmca-checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--gold);
}

.dmca-submit-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--gold);
    color: var(--charcoal-deep);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.dmca-submit-btn:hover {
    background: var(--gold-light);
}

.dmca-form-error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ff6b7a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.dmca-success-box {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #7dcea0;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.dmca-info-box {
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.dmca-info-box p {
    margin-bottom: 4px;
}

/* ========================================
   Music Library
   ======================================== */

.music-subtabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-medium);
}

.music-subtab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.music-subtab:hover {
    color: var(--text-primary);
}

.music-subtab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.music-subtab-panel {
    display: none;
}

.music-subtab-panel.active {
    display: block;
}

/* Library filters */
.library-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.library-search {
    width: 100%;
    padding: 10px 14px;
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.library-search::placeholder {
    color: var(--text-muted);
}

.library-search:focus {
    outline: none;
    border-color: var(--gold);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.filter-chip {
    padding: 5px 12px;
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--gold);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--gold);
    color: var(--midnight);
    border-color: var(--gold);
}

/* Library track list */
.library-tracks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.library-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--charcoal);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.library-track:hover {
    border-color: var(--border-medium);
}

.library-track.playing {
    border-color: var(--gold);
}

.library-track__play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--midnight);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: transform 0.1s;
}

.library-track__play:hover {
    transform: scale(1.1);
}

.library-track__info {
    flex: 1;
    min-width: 0;
}

.library-track__title {
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-track__meta {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

.library-track__meta span {
    margin-right: 12px;
}

.library-track__waveform {
    width: 120px;
    height: 32px;
    flex-shrink: 0;
}

.library-track__add {
    padding: 6px 14px;
    background: var(--gold);
    color: var(--midnight);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}

.library-track__add:hover {
    background: var(--gold-light);
}

.library-track__add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.library-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

.library-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

/* Waveform canvas */
.waveform-canvas {
    width: 100%;
    height: 32px;
    display: block;
}

/* AI generation */
.ai-generate-form {
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.ai-generate-form__row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ai-generate-form__field {
    flex: 1;
    min-width: 140px;
}

.ai-generate-form__label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.ai-generate-form__select {
    width: 100%;
    padding: 8px 12px;
    background: var(--midnight);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.ai-generate-form__select:focus {
    outline: none;
    border-color: var(--gold);
}

.ai-generate-result {
    margin-top: 16px;
    padding: 16px;
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
}

/* Upgrade prompt for music library */
.library-upgrade-prompt {
    text-align: center;
    padding: 40px 20px;
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
}

.library-upgrade-prompt__icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.library-upgrade-prompt__title {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.library-upgrade-prompt__text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .library-track {
        flex-wrap: wrap;
    }
    .library-track__waveform {
        width: 100%;
        order: 10;
    }
    .ai-generate-form__row {
        flex-direction: column;
    }
}

/* ========================================
   Auth Pages
   ======================================== */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--charcoal);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.auth-card__header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-card__subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.auth-card__alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.auth-card__alert--error {
    background: rgba(232, 160, 180, 0.1);
    border: 1px solid rgba(232, 160, 180, 0.3);
    color: var(--rose);
}

.auth-card__alert--success {
    background: rgba(143, 184, 154, 0.1);
    border: 1px solid rgba(143, 184, 154, 0.3);
    color: var(--sage);
}

.auth-card__submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.875rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.password-wrapper {
    position: relative;
}

.password-wrapper .modal__input {
    padding-right: 60px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 2px 4px;
}

.password-toggle:hover {
    color: var(--gold);
}

.password-strength {
    display: flex;
    gap: 4px;
    margin-top: -0.5rem;
    margin-bottom: 0.25rem;
}

.password-strength__bar {
    flex: 1;
    height: 3px;
    background: var(--slate);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength__bar span {
    display: block;
    height: 100%;
    width: 0;
    transition: width 0.2s, background 0.2s;
    border-radius: 2px;
}

.password-strength__hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.auth-card__footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-card__footer a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
}

.auth-card__footer a:hover {
    text-decoration: underline;
}

.auth-card__footer-divider {
    margin: 0 0.5rem;
    color: var(--border-medium);
}

.auth-card__link-btn {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 0;
    text-decoration: none;
}

.auth-card__link-btn:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
        border-radius: var(--radius-md);
    }

    .auth-card__title {
        font-size: 1.5rem;
    }
}

/* ========================================
   Auth Divider ("or")
   ======================================== */

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-medium);
}

.auth-divider span {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: lowercase;
}

.passkey-btn {
    width: 100%;
}

/* ========================================
   Settings Page
   ======================================== */

.settings-page {
    padding: 2rem 1rem 4rem;
}

.settings-container {
    max-width: 640px;
    margin: 0 auto;
}

.settings-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.settings-section {
    background: var(--charcoal);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-section__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.settings-section__desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.settings-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.settings-field:last-child {
    border-bottom: none;
}

.settings-field__label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.settings-field__value {
    font-weight: 500;
}

.settings-tier-badge {
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
}

.settings-tier-badge--free {
    background: rgba(156, 163, 175, 0.2);
    color: var(--text-muted);
}

.settings-tier-badge--premium {
    background: rgba(212, 168, 83, 0.2);
    color: var(--gold-light);
}

.settings-tier-badge--pro {
    background: rgba(107, 165, 201, 0.2);
    color: var(--ocean);
}

.settings-add-btn {
    margin-top: 1rem;
}

/* Passkey list */

.passkey-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.passkey-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--slate);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.passkey-row__info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.passkey-row__name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.passkey-row__meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.passkey-row__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.passkey-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 1rem 0;
}

.passkey-status {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.passkey-status--success {
    color: var(--sage);
    background: rgba(143, 184, 154, 0.1);
}

.passkey-status--error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.passkey-error {
    color: #ef4444;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .passkey-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .passkey-row__actions {
        width: 100%;
    }
}
