/* ============================================================
   Songcraft - Dark Theme
   ============================================================ */

/* Alpine.js x-show compatibility - override Bootstrap !important display utilities */
[x-cloak] { display: none !important; }
[style*="display: none"] { display: none !important; }
[style*="display:none"] { display: none !important; }

:root {
    --sc-accent-rgb: 229, 9, 20;
    --sc-accent-light-rgb: 255, 77, 88;
    --sc-accent-highlight-rgb: 255, 107, 115;
    --sc-primary: #E50914;
    --sc-primary-hover: #C00710;
    --sc-primary-light: #FF4D58;
    --sc-primary-highlight: #FF6B73;
    --sc-primary-highlight-bright: #FF8A90;
    --sc-bg: #0c0c10;
    --sc-surface: #16161d;
    --sc-surface-border: rgba(var(--sc-accent-rgb), 0.12);
    --sc-surface-hover: rgba(var(--sc-accent-rgb), 0.18);
    --sc-text: #e4e4e7;
    --sc-text-muted: #8b8b96;
    --sc-glass: rgba(22, 22, 29, 0.65);
    --sc-glass-border: rgba(var(--sc-accent-rgb), 0.10);
    --sc-danger: #ef4444;
    --sc-success: #22c55e;
}

/* --- Base --- */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--sc-bg);
    color: var(--sc-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

main { flex: 1; position: relative; z-index: 1; }

a { color: var(--sc-primary-light); }
a:hover { color: var(--sc-primary); }

/* --- Bootstrap overrides - buttons --- */
.btn {
    font-weight: 500;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(160deg, var(--sc-primary-highlight) 0%, var(--sc-primary) 50%, var(--sc-primary-hover) 100%);
    border: 1px solid rgba(var(--sc-accent-highlight-rgb), 0.4);
    color: #1a1a1a;
    font-weight: 600;
    border-radius: 999px;
    transition: all 0.3s ease;
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.15) inset,
        0 2px 8px rgba(var(--sc-accent-rgb), 0.2);
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(160deg, var(--sc-primary-highlight-bright) 0%, var(--sc-primary-light) 50%, var(--sc-primary) 100%);
    border-color: rgba(var(--sc-accent-highlight-rgb), 0.6);
    color: #1a1a1a;
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.2) inset,
        0 4px 20px rgba(var(--sc-accent-rgb), 0.35),
        0 0 40px rgba(var(--sc-accent-rgb), 0.15);
    transform: translateY(-1px);
}
.btn-primary:active {
    background: linear-gradient(160deg, var(--sc-primary-light) 0%, var(--sc-primary) 50%, var(--sc-primary-hover) 100%) !important;
    border-color: rgba(var(--sc-accent-rgb), 0.5) !important;
    color: #1a1a1a !important;
    transform: translateY(0);
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.1) inset,
        0 1px 4px rgba(var(--sc-accent-rgb), 0.2) !important;
}

.btn-outline-primary {
    color: var(--sc-primary-light);
    border: 1px solid rgba(var(--sc-accent-rgb), 0.35);
    border-radius: 999px;
    background: rgba(var(--sc-accent-rgb), 0.06);
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(var(--sc-accent-rgb), 0);
}
.btn-outline-primary:hover,
.btn-outline-primary.active,
.btn-outline-primary:active {
    background: linear-gradient(160deg, var(--sc-primary-highlight) 0%, var(--sc-primary) 50%, var(--sc-primary-hover) 100%);
    border-color: rgba(var(--sc-accent-highlight-rgb), 0.5);
    color: #1a1a1a;
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.15) inset,
        0 4px 20px rgba(var(--sc-accent-rgb), 0.3);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: var(--sc-text-muted);
    border: 1px solid rgba(139, 139, 150, 0.25);
    background: rgba(139, 139, 150, 0.04);
    border-radius: 999px;
    transition: all 0.3s ease;
}
.btn-outline-secondary:hover {
    background: rgba(139, 139, 150, 0.1);
    border-color: rgba(139, 139, 150, 0.45);
    color: var(--sc-text);
    box-shadow: 0 2px 12px rgba(139, 139, 150, 0.08);
    transform: translateY(-1px);
}

.btn-outline-dark {
    color: var(--sc-text);
    border: 1px solid rgba(228, 228, 231, 0.15);
    background: rgba(228, 228, 231, 0.03);
    border-radius: 999px;
    transition: all 0.3s ease;
}
.btn-outline-dark:hover {
    background: rgba(228, 228, 231, 0.08);
    border-color: rgba(228, 228, 231, 0.3);
    color: #fff;
    box-shadow: 0 2px 12px rgba(228, 228, 231, 0.06);
    transform: translateY(-1px);
}

.btn-glass-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e4e4e7;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    font-weight: 500;
}
.btn-glass-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: 0 2px 16px rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.btn-outline-warning {
    color: var(--sc-primary-light);
    border-color: rgba(var(--sc-accent-rgb), 0.4);
    background: rgba(var(--sc-accent-rgb), 0.06);
    border-radius: 999px;
    transition: all 0.3s ease;
}
.btn-outline-warning:hover {
    color: #1a1a1a;
    background: linear-gradient(160deg, var(--sc-primary-highlight) 0%, var(--sc-primary) 50%, var(--sc-primary-hover) 100%);
    border-color: rgba(var(--sc-accent-highlight-rgb), 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--sc-accent-highlight-rgb), 0.2);
}

.btn-outline-danger {
    border-radius: 999px;
    transition: all 0.3s ease;
}
.btn-outline-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.text-primary { color: var(--sc-primary) !important; }

/* --- Glass navbar --- */
.navbar-glass {
    background: rgba(12, 12, 16, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--sc-glass-border);
}
.navbar-glass .navbar-brand {
    padding: 0;
}
.navbar-logo {
    height: 50px;
    width: auto;
}

.nav-pills-glass {
    gap: 0.35rem;
    align-items: center;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem !important;
    border-radius: 999px !important;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--sc-text-muted) !important;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}
.nav-pill:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}
.nav-pill:active {
    transform: translateY(0);
}

/* ── Avatar Dropdown ── */
.nav-avatar-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    color: inherit;
}
.nav-avatar-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}
.nav-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.nav-avatar-initial {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}
.nav-avatar-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--sc-bg);
}
.nav-avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(20, 20, 28, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0.5rem 0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1050;
}
.nav-avatar-header {
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-avatar-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
}
.nav-avatar-tier {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.nav-avatar-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0.25rem 0;
}
.nav-avatar-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.nav-avatar-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.nav-avatar-locked {
    opacity: 0.5;
}
.nav-avatar-locked:hover {
    opacity: 0.8;
}
.nav-avatar-signout:hover {
    color: #ef4444;
}
.nav-pill-muted {
    color: var(--sc-text-muted) !important;
    background: transparent;
    border-color: transparent;
    opacity: 0.7;
}
.nav-pill-muted:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

/* --- Glass cards --- */
.card {
    position: relative;
    background: var(--sc-glass);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid var(--sc-glass-border);
    border-radius: 12px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    color: var(--sc-text);
    overflow: hidden;
}
/* Diagonal shine sweep */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.03) 45%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.03) 55%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s;
    opacity: 0;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.card:hover {
    box-shadow: 0 8px 32px rgba(var(--sc-accent-rgb), 0.10), 0 0 1px rgba(255, 255, 255, 0.08) !important;
    border-color: var(--sc-surface-hover);
    transform: translateY(-2px);
}
.card-title { color: var(--sc-text); }

/* --- Gallery image cards --- */
.gallery-card {
    position: relative;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.gallery-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.03) 45%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.03) 55%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s;
    opacity: 0;
}
.gallery-card:hover::before { opacity: 1; }
.gallery-card:hover {
    box-shadow: 0 8px 32px rgba(var(--sc-accent-rgb), 0.10), 0 0 1px rgba(255, 255, 255, 0.08);
    border-color: var(--sc-surface-hover) !important;
    transform: translateY(-2px);
}
.gallery-card img {
    transition: transform 0.3s;
}
.gallery-card:hover img {
    transform: scale(1.03);
}

/* --- Artist cards (full-bleed image) --- */
.artist-card {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--sc-glass-border);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.artist-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(var(--sc-accent-rgb), 0.12);
    border-color: var(--sc-surface-hover);
}
.artist-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.artist-card:hover .artist-card-bg { transform: scale(1.04); }
.artist-card-bg-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(217,119,6,0.12), rgba(12,12,16,0.9));
}
.artist-card-bg-fallback i {
    font-size: 4rem;
    color: var(--sc-primary);
    opacity: 0.3;
}
.artist-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(12, 12, 16, 0.92) 0%,
        rgba(12, 12, 16, 0.4) 50%,
        transparent 100%
    );
    pointer-events: none;
}
.artist-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem;
    z-index: 1;
}
.artist-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.4rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.artist-card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}
.artist-card-genres .badge {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.artist-card-meta {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
}

/* --- Dark form controls --- */
.form-control,
.form-select {
    background: rgba(12, 12, 16, 0.6);
    border: 1px solid rgba(139, 139, 150, 0.2);
    color: var(--sc-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
.form-select:focus {
    background: rgba(12, 12, 16, 0.8);
    border-color: var(--sc-primary);
    color: var(--sc-text);
    box-shadow: 0 0 0 3px rgba(var(--sc-accent-rgb), 0.15);
}
.form-control::placeholder {
    color: var(--sc-text-muted);
    opacity: 0.6;
}
.form-text { color: var(--sc-text-muted); }
.form-label { color: var(--sc-text-muted); }

.form-check-input {
    background-color: rgba(12, 12, 16, 0.6);
    border-color: rgba(139, 139, 150, 0.3);
}
.form-check-input:checked {
    background-color: var(--sc-primary);
    border-color: var(--sc-primary);
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(var(--sc-accent-rgb), 0.15);
    border-color: var(--sc-primary);
}
.form-check-label { color: var(--sc-text-muted); }

select option {
    background: var(--sc-surface);
    color: var(--sc-text);
}

/* --- Text helpers --- */
.text-muted { color: var(--sc-text-muted) !important; }

/* --- Badges --- */
.badge.bg-secondary { background: rgba(139, 139, 150, 0.2) !important; color: var(--sc-text-muted); }
.badge.bg-success { background: rgba(34, 197, 94, 0.15) !important; color: var(--sc-success); }
.badge.bg-warning { background: rgba(var(--sc-accent-rgb), 0.15) !important; color: var(--sc-primary-light); }
.text-warning { color: var(--sc-primary-light) !important; }
.badge.bg-danger { background: rgba(239, 68, 68, 0.15) !important; color: var(--sc-danger); }
.badge.bg-info { background: rgba(56, 189, 248, 0.12) !important; color: #38bdf8; }
.badge.bg-light { background: rgba(228, 228, 231, 0.08) !important; color: var(--sc-text-muted); border-color: rgba(139, 139, 150, 0.2) !important; }
.text-dark { color: var(--sc-text-muted) !important; }

/* --- Success & danger card borders --- */
.card.border-success {
    border-color: rgba(34, 197, 94, 0.35) !important;
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.08);
}
.card.border-danger {
    border-color: rgba(239, 68, 68, 0.35) !important;
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.08);
}
.text-success { color: var(--sc-success) !important; }
.text-danger { color: var(--sc-danger) !important; }

/* --- Pre/code blocks --- */
pre.bg-light {
    background: rgba(12, 12, 16, 0.5) !important;
    color: var(--sc-text-muted);
    border: 1px solid rgba(139, 139, 150, 0.15);
}
details summary { color: var(--sc-text-muted); }

/* --- Filter tabs (generations page) --- */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--sc-text-muted);
    background: var(--sc-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--sc-glass-border);
    transition: all 0.25s ease;
}

.filter-tab:hover {
    color: var(--sc-primary-light);
    border-color: rgba(var(--sc-accent-rgb), 0.25);
    background: rgba(var(--sc-accent-rgb), 0.06);
    box-shadow: 0 0 12px rgba(var(--sc-accent-rgb), 0.1);
}

.filter-tab.active {
    color: #fff;
    background: rgba(var(--sc-accent-rgb), 0.15);
    border-color: var(--sc-primary);
    box-shadow: 0 0 20px rgba(var(--sc-accent-rgb), 0.2), inset 0 0 12px rgba(var(--sc-accent-rgb), 0.08);
}

.filter-tab i {
    font-size: 0.85rem;
}

/* Smaller filter tabs for time/tag rows */
.filter-tab-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
}

.filter-tab-sm i {
    font-size: 0.7rem;
}

.filter-divider {
    width: 1px;
    height: 1.2rem;
    background: rgba(139, 139, 150, 0.2);
    margin: 0 0.25rem;
    align-self: center;
}

/* --- Tags --- */
.song-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.song-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    background: rgba(var(--sc-accent-rgb), 0.08);
    color: var(--sc-primary-light);
    line-height: 1.4;
}

.song-tag-label {
    text-decoration: none;
    color: inherit;
}

.song-tag-label:hover {
    color: #fff;
}

.song-tag-remove {
    background: none;
    border: none;
    color: var(--sc-text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1;
    margin-left: 0.1rem;
}

.song-tag-remove:hover {
    color: var(--sc-danger);
}

.song-tag-add {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    border: 1px dashed rgba(var(--sc-accent-rgb), 0.2);
    background: none;
    color: var(--sc-text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.song-tag-add:hover {
    color: var(--sc-primary-light);
    border-color: var(--sc-primary-light);
    background: rgba(var(--sc-accent-rgb), 0.06);
}

.song-tag-form {
    align-items: center;
    gap: 0.25rem;
}

.song-tag-input {
    width: 5rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(var(--sc-accent-rgb), 0.25);
    background: rgba(0,0,0,0.3);
    color: var(--sc-text);
    font-size: 0.7rem;
    outline: none;
}

.song-tag-input:focus {
    border-color: var(--sc-primary-light);
    box-shadow: 0 0 8px rgba(var(--sc-accent-rgb), 0.2);
}

.song-tag-add-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 4px;
    border: none;
    background: rgba(var(--sc-accent-rgb), 0.15);
    color: var(--sc-primary-light);
    cursor: pointer;
    font-size: 0.7rem;
}

.song-tag-add-confirm:hover {
    background: rgba(var(--sc-accent-rgb), 0.25);
}

/* Read-only tag pills on song cards */
.song-tag-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    background: rgba(var(--sc-accent-rgb), 0.06);
    border: 1px solid rgba(var(--sc-accent-rgb), 0.12);
    color: var(--sc-primary-light);
    text-decoration: none;
    line-height: 1.4;
}

.song-tag-sm:hover {
    color: #fff;
    background: rgba(var(--sc-accent-rgb), 0.12);
}

.song-tag-sm i {
    font-size: 0.6rem;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 2;
    padding: 3rem 0 2rem;
    margin-top: 3rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    background: rgba(12, 12, 16, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(var(--sc-accent-rgb), 0.06);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sc-primary-light);
}

.footer-brand i {
    font-size: 1.3rem;
}

.footer-tagline {
    color: var(--sc-text-muted);
    font-size: 0.85rem;
    margin: 0;
    letter-spacing: 0.05em;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--sc-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--sc-primary-light);
}

.footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--sc-primary);
    opacity: 0.5;
}

.footer-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.footer-legal a {
    color: var(--sc-text-muted);
    font-size: 0.75rem;
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.footer-legal a:hover {
    opacity: 1;
    color: var(--sc-text);
}

.footer-copy {
    color: rgba(139, 139, 150, 0.4);
    font-size: 0.7rem;
    margin-top: 0.5rem;
}

.footer-copy a {
    color: inherit;
    text-decoration: none;
}

.footer-copy a:hover {
    color: var(--sc-text-muted);
}

/* --- Legal pages --- */
.legal-page {
    padding: 1rem 0 3rem;
}

.legal-page h2 {
    margin-bottom: 0.25rem;
}

.legal-page h3 {
    font-size: 1.05rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--sc-text);
}

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

.legal-page p,
.legal-page li {
    color: var(--sc-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.legal-page ul {
    padding-left: 1.5rem;
}

.legal-page a {
    color: var(--sc-primary-light);
}

/* --- Audio Visualizer Player --- */
audio { border-radius: 8px; }

/* Ambient light halo */
.player-ambient-wrap {
    position: relative;
    width: 100%;
    max-width: clamp(200px, 90vw, 440px);
    margin: 0 auto 1rem;
}
.player-ambient-canvas {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.player-ambient-wrap .player-hero {
    position: relative;
    z-index: 1;
    max-width: none;
    margin: 0;
}

/* Hero player: cover art + glass + radial viz stacked */
.player-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: clamp(200px, 90vw, 440px);
    margin: 0 auto 1rem;
    border-radius: 16px;
    overflow: hidden;
}

.player-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.player-hero-bg-fallback {
    background: linear-gradient(135deg,
        rgba(var(--sc-accent-rgb), 0.15) 0%,
        rgba(12, 12, 16, 0.8) 50%,
        rgba(var(--sc-accent-rgb), 0.1) 100%
    );
}

.player-hero-glass {
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 16, 0.2);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.player-hero-viz {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-hero-viz canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.player-hero-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(var(--sc-accent-rgb), 0.5);
    background: rgba(12, 12, 16, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--sc-primary-light);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    z-index: 2;
}
.player-hero-play:hover {
    background: rgba(var(--sc-accent-rgb), 0.3);
    border-color: var(--sc-primary-light);
    box-shadow: 0 0 30px rgba(var(--sc-accent-rgb), 0.4);
    transform: translate(-50%, -50%) scale(1.08);
}
.player-hero-play.active {
    border-color: var(--sc-primary-light);
    background: rgba(var(--sc-accent-rgb), 0.2);
    box-shadow: 0 0 20px rgba(var(--sc-accent-rgb), 0.3);
}

/* Cover upload button */
.cover-upload-form { position: absolute; bottom: 10px; right: 10px; z-index: 3; }
.cover-upload-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(12, 12, 16, 0.6);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: var(--sc-text-muted); font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.25s; opacity: 0;
}
.player-hero:hover .cover-upload-btn { opacity: 1; }
.cover-upload-btn:hover {
    background: rgba(var(--sc-accent-rgb), 0.3);
    border-color: var(--sc-primary-light);
    color: var(--sc-text);
}

/* Card hero player (mini version for song cards) */
.card-hero-player {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0;
}
.card-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-hero-bg-fallback {
    background:
        url('/logo.png') center center / 70% no-repeat,
        linear-gradient(135deg,
            rgba(var(--sc-accent-rgb), 0.15) 0%,
            rgba(12, 12, 16, 0.8) 50%,
            rgba(var(--sc-accent-rgb), 0.1) 100%
        );
}
.card-hero-glass {
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 16, 0.1);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.card-hero-viz {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-hero-viz canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.card-hero-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: rgba(12, 12, 16, 0.6);
}
.card-hero-time {
    font-size: 0.7rem;
    color: var(--sc-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.progress-track {
    flex: 1;
    height: 4px;
    background: rgba(139, 139, 150, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}
.progress-track::before {
    content: '';
    position: absolute;
    top: -12px;
    bottom: -12px;
    left: 0;
    right: 0;
}
.progress-track:hover {
    height: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sc-primary), var(--sc-primary-light));
    border-radius: 2px;
    transition: width 0.1s linear;
    position: relative;
    pointer-events: none;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sc-primary-light);
    opacity: 0;
    transition: opacity 0.15s;
}
.progress-track:hover .progress-fill::after {
    opacity: 1;
}

.progress-time {
    font-size: 0.75rem;
    color: var(--sc-text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* --- Waveform Timeline --- */
.player-waveform-wrap {
    margin-top: 0.75rem;
    padding: 0.5rem 0;
}
.player-waveform-time {
    font-size: 0.75rem;
    color: var(--sc-text-muted);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.4rem;
    text-align: center;
}
.player-waveform-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.player-waveform-play {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(var(--sc-accent-light-rgb), 0.4);
    background: rgba(var(--sc-accent-rgb), 0.1);
    color: var(--sc-primary-light);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.player-waveform-play:hover {
    background: rgba(var(--sc-accent-rgb), 0.2);
    border-color: rgba(var(--sc-accent-light-rgb), 0.6);
    transform: scale(1.05);
}
.player-waveform-track {
    flex: 1;
    height: 80px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(139, 139, 150, 0.06);
}
.player-waveform-track canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Version card waveform player ── */
.version-waveform-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.version-waveform-play {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(var(--sc-accent-light-rgb), 0.4);
    background: rgba(var(--sc-accent-rgb), 0.08);
    color: rgba(var(--sc-accent-light-rgb), 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}
.version-waveform-play:hover {
    background: rgba(var(--sc-accent-rgb), 0.2);
    border-color: rgba(var(--sc-accent-light-rgb), 0.6);
    transform: scale(1.05);
}
.version-waveform-play.active {
    background: rgba(var(--sc-accent-rgb), 0.15);
    border-color: rgba(var(--sc-accent-light-rgb), 0.6);
}
.version-waveform-track {
    flex: 1;
    height: 48px;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}
.version-waveform-track canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.version-waveform-time {
    flex-shrink: 0;
    color: rgba(255,255,255,0.4);
    font-size: 0.65rem;
    min-width: 70px;
    text-align: right;
}

/* --- Settings page --- */
.settings-section {
    background: var(--sc-glass-bg);
    border: 1px solid var(--sc-glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.settings-section-title {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--sc-primary-light);
}
.settings-usage-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--sc-glass-border);
    border-radius: 8px;
    padding: 0.75rem;
}
.settings-usage-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.25rem;
}
.settings-usage-value {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.settings-usage-bar {
    height: 8px;
    background: repeating-linear-gradient(90deg,
        rgba(255,255,255,0.06) 0px, rgba(255,255,255,0.06) 6px,
        transparent 6px, transparent 8px);
    border-radius: 2px;
    overflow: hidden;
}
.settings-usage-fill {
    height: 100%;
    background: repeating-linear-gradient(90deg,
        var(--sc-primary) 0px, var(--sc-primary) 6px,
        transparent 6px, transparent 8px);
    border-radius: 0;
    transition: width 0.3s;
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.3);
}
.settings-tier-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(217, 119, 6, 0.15);
    color: var(--sc-primary);
    border: 1px solid rgba(217, 119, 6, 0.3);
}

/* --- Generation history log --- */
.history-log {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.history-entry {
    padding: 0.5rem 0.75rem;
    border-left: 2px solid var(--sc-glass-border);
}
.history-entry-current {
    border-left-color: var(--sc-primary);
    background: rgba(217, 119, 6, 0.04);
}

/* --- Share controls --- */
.share-controls {
    padding: 0.75rem 0;
}
.share-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.share-link-row .form-control {
    background: rgba(12, 12, 16, 0.4);
    border-color: var(--sc-glass-border);
    color: var(--sc-text);
    font-size: 0.8rem;
}
.share-social {
    display: flex;
    gap: 0.5rem;
}

/* Card cover image (non-player fallback) */
.card-cover-img {
    height: 160px;
    object-fit: cover;
}

/* --- Card player (My Songs list) --- */
.card-player {
    margin-top: 0.25rem;
}

.card-player-viz {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(12, 12, 16, 0.4);
}
.card-player-viz canvas {
    display: block;
    width: 100%;
}
/* Radial viz in card */
.card-radial-viz {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.25rem;
}
.card-radial-viz canvas {
    display: block;
    max-width: 160px;
    max-height: 160px;
}
.card-radial-play {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--sc-primary);
    background: rgba(12, 12, 16, 0.7);
    color: var(--sc-primary-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    z-index: 2;
}
.card-radial-play:hover {
    background: var(--sc-primary);
    color: #fff;
    box-shadow: 0 0 16px rgba(var(--sc-accent-rgb), 0.4);
}
.card-radial-play.active {
    background: rgba(var(--sc-accent-rgb), 0.15);
    animation: playGlow 2s ease-in-out infinite;
}

.card-radial-progress {
    flex: 1;
    height: 3px;
    background: rgba(139, 139, 150, 0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}
.card-radial-progress:hover { height: 5px; }
.card-radial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sc-primary), var(--sc-primary-light));
    border-radius: 2px;
    transition: width 0.1s linear;
}

/* Generating mini radial */
.card-generating-viz {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.5rem;
}
.card-generating-viz canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.generating-radial-viz {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}
.generating-radial-viz canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.card-player-progress {
    display: none;
}

.card-player-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0 0.25rem;
}

.card-play-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--sc-primary);
    background: rgba(var(--sc-accent-rgb), 0.08);
    color: var(--sc-primary-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
}
.card-play-btn:hover {
    background: var(--sc-primary);
    color: #fff;
    box-shadow: 0 0 16px rgba(var(--sc-accent-rgb), 0.4);
}
.card-play-btn.active {
    background: rgba(var(--sc-accent-rgb), 0.15);
    box-shadow: 0 0 12px rgba(var(--sc-accent-rgb), 0.25);
    animation: playGlow 2s ease-in-out infinite;
}

@keyframes playGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(var(--sc-accent-rgb), 0.2); }
    50%      { box-shadow: 0 0 20px rgba(var(--sc-accent-rgb), 0.45); }
}

.card-player-time {
    font-size: 0.7rem;
    color: var(--sc-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.card-player-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.card-player-action {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sc-text-muted);
    font-size: 0.8rem;
    transition: all 0.2s;
    text-decoration: none;
}
.card-player-action:hover {
    color: var(--sc-primary-light);
    background: rgba(var(--sc-accent-rgb), 0.1);
}

/* --- HTMX indicators --- */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-flex;
    align-items: center;
}
.htmx-request button[type="submit"] {
    opacity: 0.6;
    pointer-events: none;
}

/* --- HTMX swap fade-in --- */
.htmx-settling > * {
    animation: fadeSlideIn 0.35s ease-out;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Recording dot --- */
.recording-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--sc-danger);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

/* --- Alpine cloak --- */
[x-cloak] { display: none !important; }

/* ============================================================
   Hero - gradient text
   ============================================================ */
.hero-title {
    color: var(--sc-text);
}

/* ============================================================
   Hero Visualizer (radial sound ring behind text)
   ============================================================ */
.hero-viz-section {
    position: relative;
    width: 100%;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    padding: 3rem 0;
}
.hero-viz-section canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}
.hero-viz-content {
    position: relative;
    z-index: 1;
}

/* ============================================================
   Floating music notes (CSS-only particles)
   ============================================================ */
.floating-notes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.floating-notes span {
    position: absolute;
    bottom: -40px;
    font-size: 1.5rem;
    color: rgba(var(--sc-accent-rgb), 0.12);
    animation: floatUp linear infinite;
}
.floating-notes span:nth-child(1) { left: 8%;  animation-duration: 8s;  animation-delay: 0s;   font-size: 1.2rem; }
.floating-notes span:nth-child(2) { left: 22%; animation-duration: 11s; animation-delay: 2s;   font-size: 1.8rem; }
.floating-notes span:nth-child(3) { left: 40%; animation-duration: 9s;  animation-delay: 4s;   font-size: 1.4rem; }
.floating-notes span:nth-child(4) { left: 58%; animation-duration: 12s; animation-delay: 1s;   font-size: 2rem;   }
.floating-notes span:nth-child(5) { left: 75%; animation-duration: 10s; animation-delay: 3s;   font-size: 1.3rem; }
.floating-notes span:nth-child(6) { left: 90%; animation-duration: 9s;  animation-delay: 5s;   font-size: 1.6rem; }

@keyframes floatUp {
    0%   { transform: translateY(0) rotate(0deg);   opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-85vh) rotate(45deg); opacity: 0; }
}

/* --- Liquid gradient animation (CSS Houdini) --- */
@property --liquid-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes liquid-rotate {
    to { --liquid-angle: 360deg; }
}

/* ============================================================
   Feature cards (home page)
   ============================================================ */
.feature-card {
    position: relative;
    padding: 2rem 1.5rem;
    border: 1.5px solid transparent;
    border-radius: 12px;
    background:
        var(--sc-glass) padding-box,
        conic-gradient(
            from var(--liquid-angle),
            rgba(229, 9, 20, 0.65),
            rgba(160, 10, 20, 0.12),
            rgba(255, 77, 88, 0.5),
            rgba(140, 8, 15, 0.08),
            rgba(200, 15, 25, 0.4),
            rgba(229, 9, 20, 0.65)
        ) border-box;
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    text-align: center;
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s;
    box-shadow:
        0 0 8px rgba(var(--sc-accent-rgb), 0.08),
        0 0 25px rgba(var(--sc-accent-rgb), 0.05),
        inset 0 0 12px rgba(var(--sc-accent-rgb), 0.03);
    overflow: hidden;
    animation: liquid-rotate var(--liquid-duration, 6s) linear infinite;
    animation-delay: var(--liquid-delay, 0s);
}

/* Second liquid layer - slower, offset, blurred for organic depth */
.feature-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 12px;
    padding: 2.5px;
    background: conic-gradient(
        from calc(var(--liquid-angle) + 150deg),
        transparent 0%,
        rgba(255, 120, 130, 0.3) 10%,
        transparent 25%,
        rgba(229, 9, 20, 0.2) 45%,
        transparent 60%,
        rgba(255, 77, 88, 0.18) 75%,
        transparent 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: liquid-rotate var(--liquid-duration-slow, 9s) linear infinite;
    animation-delay: var(--liquid-delay, 0s);
    filter: blur(2px);
}

.feature-card:hover::after {
    animation-duration: 4.5s;
}

.feature-card > * { position: relative; z-index: 1; }
.feature-card:hover {
    box-shadow:
        0 0 12px rgba(var(--sc-accent-rgb), 0.15),
        0 0 35px rgba(var(--sc-accent-rgb), 0.08),
        0 0 80px rgba(var(--sc-accent-rgb), 0.04),
        inset 0 0 25px rgba(var(--sc-accent-rgb), 0.04);
    transform: translateY(-3px);
}
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(var(--sc-accent-rgb), 0.10);
    color: var(--sc-primary-light);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.feature-step {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    background: var(--sc-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ============================================================
   Create page - glassy modern wizard
   ============================================================ */

/* Header */
.create-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.create-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: rgba(var(--sc-accent-rgb), 0.1);
    border: 1px solid rgba(var(--sc-accent-rgb), 0.15);
    color: var(--sc-primary-light);
    font-size: 1.6rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 30px rgba(var(--sc-accent-rgb), 0.1);
}

.create-header-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--sc-primary);
}

.create-header-sub {
    color: var(--sc-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Step card */
.create-step {
    position: relative;
    background: var(--sc-glass);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--sc-glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    overflow: hidden;
}
.create-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(var(--sc-accent-rgb), 0.2) 20%,
        rgba(var(--sc-accent-light-rgb), 0.35) 50%,
        rgba(var(--sc-accent-rgb), 0.2) 80%,
        transparent
    );
}

/* Step indicator */
.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(var(--sc-accent-rgb), 0.12);
    border: 1px solid rgba(var(--sc-accent-rgb), 0.25);
    color: var(--sc-primary-light);
    font-size: 0.75rem;
    font-weight: 700;
}

.step-number.step-done {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--sc-success);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sc-text-muted);
}

/* Prompt label */
.create-prompt-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sc-text);
    margin-bottom: 0.25rem;
}

/* Textarea */
.create-textarea-wrap {
    position: relative;
}

.create-textarea {
    background: rgba(12, 12, 16, 0.5) !important;
    border: 1px solid rgba(139, 139, 150, 0.15) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s !important;
}

.create-textarea:focus {
    border-color: var(--sc-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--sc-accent-rgb), 0.1), 0 0 20px rgba(var(--sc-accent-rgb), 0.08) !important;
}

.create-textarea-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.35rem;
}

/* Actions row */
.create-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Voice button */
.create-voice-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(139, 139, 150, 0.2);
    background: transparent;
    color: var(--sc-text-muted);
    font-size: 0.85rem;
    transition: all 0.25s;
    cursor: pointer;
}
.create-voice-btn:hover {
    border-color: rgba(139, 139, 150, 0.4);
    color: var(--sc-text);
    background: rgba(139, 139, 150, 0.06);
}
.create-voice-btn.recording {
    border-color: var(--sc-danger);
    color: var(--sc-danger);
    background: rgba(239, 68, 68, 0.08);
    animation: recordPulse 1.5s ease-in-out infinite;
}

@keyframes recordPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.12); }
}

/* Idea echo */
.create-idea-echo {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(var(--sc-accent-rgb), 0.04);
    border: 1px solid rgba(var(--sc-accent-rgb), 0.08);
    margin-bottom: 1.5rem;
    color: var(--sc-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}
.create-idea-echo i {
    color: var(--sc-primary);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Mode toggle */
.create-mode-toggle {
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(139, 139, 150, 0.15);
    background: transparent;
    color: var(--sc-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
}
.mode-btn:hover {
    border-color: rgba(var(--sc-accent-rgb), 0.25);
    color: var(--sc-primary-light);
}
.mode-btn.active {
    background: rgba(var(--sc-accent-rgb), 0.12);
    border-color: var(--sc-primary);
    color: var(--sc-primary-light);
    box-shadow: 0 0 16px rgba(var(--sc-accent-rgb), 0.15);
}

/* Section labels */
.create-section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sc-text-muted);
}

/* Options grid */
.create-option-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.create-option-grid.two-col {
    grid-template-columns: repeat(2, 1fr);
}
.create-option-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.create-option-item .form-label {
    margin-bottom: 0.3rem;
}

/* Custom checkboxes */
.create-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    height: 38px; /* match form-select height */
    color: var(--sc-text-muted);
    font-size: 0.85rem;
    user-select: none;
}
.create-check input { display: none; }

.create-check-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1.5px solid rgba(139, 139, 150, 0.25);
    background: rgba(12, 12, 16, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}
.create-check input:checked + .create-check-box {
    background: rgba(var(--sc-accent-rgb), 0.15);
    border-color: var(--sc-primary);
    color: var(--sc-primary-light);
    box-shadow: 0 0 8px rgba(var(--sc-accent-rgb), 0.15);
}

/* Creativity gauge */
.creativity-gauge {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: rgba(139, 139, 150, 0.1);
    overflow: hidden;
}
.creativity-gauge-fill {
    position: absolute;
    inset: 0;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s ease;
}
.creativity-gauge-glow {
    position: absolute;
    inset: -2px 0;
    border-radius: 3px;
    filter: blur(6px);
    opacity: 0.5;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s ease, opacity 0.4s ease;
}
.creativity-level-0 { background: rgba(139, 139, 150, 0.3); }
.creativity-level-1 { background: rgba(59, 130, 246, 0.7); }
.creativity-level-2 { background: rgba(217, 119, 6, 0.8); }
.creativity-level-3 { background: var(--sc-primary); }
.creativity-gauge-glow.creativity-level-0 { opacity: 0; }
.creativity-gauge-glow.creativity-level-3 {
    opacity: 0.7;
    animation: gauge-pulse 2s ease-in-out infinite;
}
@keyframes gauge-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}
.creativity-label {
    font-size: 0.75rem;
    color: var(--sc-text-muted);
    transition: color 0.3s ease;
}
.creativity-pct {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--sc-text-muted);
    opacity: 0.7;
}

/* Lyrics editor */
.create-lyrics-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(139, 139, 150, 0.12);
}

.create-lyrics {
    background: rgba(12, 12, 16, 0.5) !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    padding: 1.25rem !important;
    resize: vertical;
}
.create-lyrics:focus {
    box-shadow: inset 0 0 0 1px var(--sc-primary) !important;
}

/* Generation Summary Strip */
.generation-summary {
    padding: 0.65rem 0.85rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
}
.generation-summary-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sc-text-muted);
    margin-bottom: 0.4rem;
}
.gen-sum-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.15);
    color: rgba(255,255,255,0.7);
}
.create-lyrics::-webkit-scrollbar {
    width: 8px;
}
.create-lyrics::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
}
.create-lyrics::-webkit-scrollbar-thumb {
    background: rgba(217, 119, 6, 0.25);
    border-radius: 4px;
    border: 1px solid rgba(217, 119, 6, 0.1);
}
.create-lyrics::-webkit-scrollbar-thumb:hover {
    background: rgba(217, 119, 6, 0.4);
}

/* Lyrics details */
.create-lyrics-details summary {
    font-size: 0.8rem;
    color: var(--sc-text-muted);
    cursor: pointer;
    padding: 0.5rem 0;
}
.create-lyrics-pre {
    background: rgba(12, 12, 16, 0.4) !important;
    color: var(--sc-text-muted) !important;
    border: 1px solid rgba(139, 139, 150, 0.1) !important;
    border-radius: 10px;
    padding: 1rem !important;
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-top: 0.5rem;
}

/* Transcription pill */
.create-transcription {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.12);
}
.create-transcription-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.12);
    color: var(--sc-success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* Generating state */
.create-generating {
    border-color: rgba(var(--sc-accent-rgb), 0.15);
    animation: borderPulseCreate 2.5s ease-in-out infinite;
}
@keyframes borderPulseCreate {
    0%, 100% { border-color: rgba(var(--sc-accent-rgb), 0.1); box-shadow: 0 0 0 rgba(var(--sc-accent-rgb), 0); }
    50%      { border-color: rgba(var(--sc-accent-rgb), 0.3); box-shadow: 0 0 30px rgba(var(--sc-accent-rgb), 0.06); }
}

.generating-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(var(--sc-accent-rgb), 0.15);
    position: relative;
    animation: ringRotate 3s linear infinite;
}
.generating-ring::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--sc-primary);
    animation: ringRotate 1.5s linear infinite;
}
.generating-ring-inner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(var(--sc-accent-rgb), 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sc-primary-light);
    font-size: 1.3rem;
    animation: ringPulseInner 2s ease-in-out infinite;
}

@keyframes ringRotate {
    to { transform: rotate(360deg); }
}
@keyframes ringPulseInner {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50%      { transform: scale(1.08); opacity: 1; }
}

/* Success state */
.create-success {
    border-color: rgba(34, 197, 94, 0.2);
}
.create-success::before {
    background: linear-gradient(90deg,
        transparent,
        rgba(34, 197, 94, 0.15) 20%,
        rgba(34, 197, 94, 0.3) 50%,
        rgba(34, 197, 94, 0.15) 80%,
        transparent
    );
}

.create-final-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Error state */
.create-error {
    border-color: rgba(239, 68, 68, 0.2);
}
.create-error::before {
    background: linear-gradient(90deg,
        transparent,
        rgba(239, 68, 68, 0.15) 20%,
        rgba(239, 68, 68, 0.3) 50%,
        rgba(239, 68, 68, 0.15) 80%,
        transparent
    );
}
.create-error-icon {
    font-size: 2.5rem;
    color: var(--sc-danger);
    opacity: 0.8;
}

/* ============================================================
   CTA button liquid glow
   ============================================================ */

/* Outer wrapper - blurred halo */
.btn-liquid-wrap {
    position: relative;
    display: inline-block;
    border-radius: 10px;
}

.btn-liquid-wrap::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 14px;
    background: conic-gradient(
        from var(--liquid-angle),
        rgba(229, 9, 20, 0.5),
        rgba(160, 10, 20, 0.08),
        rgba(255, 77, 88, 0.4),
        rgba(140, 8, 15, 0.06),
        rgba(200, 15, 25, 0.35),
        rgba(229, 9, 20, 0.5)
    );
    filter: blur(18px);
    opacity: 0.45;
    animation: liquid-rotate var(--liquid-duration, 4s) linear infinite;
    animation-delay: var(--liquid-delay, 0s);
    transition: opacity 0.4s ease;
    z-index: 0;
}

.btn-liquid-wrap:hover::before {
    opacity: 0.85;
}

.btn-glow {
    position: relative;
    z-index: 1;
    box-shadow:
        0 0 6px rgba(var(--sc-accent-rgb), 0.1),
        inset 0 0 12px rgba(var(--sc-accent-rgb), 0.04);
    transition: all 0.35s ease;
    overflow: hidden;
}

/* Primary liquid border - animated conic gradient masked to border */
.btn-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(
        from var(--liquid-angle),
        rgba(229, 9, 20, 0.9),
        rgba(160, 10, 20, 0.2),
        rgba(255, 77, 88, 0.8),
        rgba(140, 8, 15, 0.15),
        rgba(200, 15, 25, 0.6),
        rgba(229, 9, 20, 0.9)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: liquid-rotate var(--liquid-duration, 4s) linear infinite;
    animation-delay: var(--liquid-delay, 0s);
}

/* Second liquid layer - offset, blurred for depth */
.btn-glow::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 2.5px;
    background: conic-gradient(
        from calc(var(--liquid-angle) + 120deg),
        transparent 0%,
        rgba(255, 120, 130, 0.4) 12%,
        transparent 28%,
        rgba(229, 9, 20, 0.3) 48%,
        transparent 62%,
        rgba(255, 77, 88, 0.25) 78%,
        transparent 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: liquid-rotate var(--liquid-duration-slow, 7s) linear infinite;
    animation-delay: var(--liquid-delay, 0s);
    filter: blur(2px);
}

.btn-glow:hover {
    box-shadow:
        0 0 10px rgba(var(--sc-accent-rgb), 0.2),
        0 0 30px rgba(var(--sc-accent-rgb), 0.1),
        inset 0 0 15px rgba(var(--sc-accent-rgb), 0.06);
    transform: translateY(-1px);
}

.btn-glow:hover::before {
    animation-duration: 2s;
}

.btn-glow:hover::after {
    animation-duration: 3.5s;
}

/* ============================================================
   Equalizer bars (generating state)
   ============================================================ */
.equalizer {
    display: inline-flex;
    align-items: flex-end;
    gap: 4px;
    height: 48px;
}
.equalizer-bar {
    width: 6px;
    border-radius: 3px;
    background: var(--sc-primary);
    animation: eqBounce 1.2s ease-in-out infinite;
}
.equalizer-bar:nth-child(1) { height: 20px; animation-delay: 0s;    }
.equalizer-bar:nth-child(2) { height: 32px; animation-delay: 0.15s; }
.equalizer-bar:nth-child(3) { height: 40px; animation-delay: 0.3s;  }
.equalizer-bar:nth-child(4) { height: 28px; animation-delay: 0.45s; }
.equalizer-bar:nth-child(5) { height: 36px; animation-delay: 0.6s;  }

@keyframes eqBounce {
    0%, 100% { transform: scaleY(0.4); opacity: 0.6; }
    50%      { transform: scaleY(1);   opacity: 1;   }
}

.card-generating {
    animation: borderPulse 2s ease-in-out infinite;
}
@keyframes borderPulse {
    0%, 100% { border-color: rgba(var(--sc-accent-rgb), 0.10); }
    50%      { border-color: rgba(var(--sc-accent-rgb), 0.35); }
}

/* ============================================================
   String theory footer
   ============================================================ */
.string-field {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.string-field canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ============================================================
   Login centering
   ============================================================ */
.login-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100svh - 200px);
}

/* ============================================================
   Mixer Console
   ============================================================ */

/* ── Rack Panel ── */
.rack-panel {
    position: relative;
    background:
        repeating-linear-gradient(90deg, transparent, rgba(255,255,255,0.005) 1px, transparent 2px),
        linear-gradient(180deg, #131319, var(--panel-bg, #111118) 3%, var(--panel-bg, #111118) 97%, #0e0e14);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 2.5rem 2rem 2rem;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.5),
        0 20px 60px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.03);
}
.rack-screw {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #38383f, #1a1a22);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.6), 0 1px 1px rgba(255,255,255,0.03);
}
.rack-screw::before {
    content: '+';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: rgba(255,255,255,0.1);
    font-weight: bold;
}
.screw-tl { top: 10px; left: 10px; }
.screw-tr { top: 10px; right: 10px; }
.screw-bl { bottom: 10px; left: 10px; }
.screw-br { bottom: 10px; right: 10px; }

/* ── Mixer Header ── */
.mixer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.mixer-header .mixer-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.3);
    color: var(--sc-primary-light);
    font-size: 0.7rem;
    font-weight: 700;
}
.rack-panel .step-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--sc-text-muted);
}
.power-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sc-success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    animation: pulse-led 3s ease-in-out infinite;
}
@keyframes pulse-led {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ── Section Label (new, coexists with .create-section-label) ── */
.rack-panel .section-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--sc-text-muted);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}
.rack-panel .section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06), transparent);
}

/* ── Mixer Divider ── */
.mixer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(229,9,20,0.12) 20%, rgba(229,9,20,0.2) 50%, rgba(229,9,20,0.12) 80%, transparent);
    margin: 1.25rem 0;
}

/* ── Mixer Mode Toggle (new names to avoid .mode-btn collision) ── */
.mixer-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.mixer-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    background: var(--channel-bg, rgba(0,0,0,0.25));
    color: var(--sc-text-muted);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.2s;
}
.mixer-mode-btn:hover {
    border-color: rgba(229,9,20,0.25);
    color: var(--sc-text);
}
.mixer-mode-btn.active {
    background: rgba(229,9,20,0.12);
    border-color: rgba(229,9,20,0.4);
    color: var(--sc-primary-light);
    box-shadow: 0 0 16px rgba(229,9,20,0.1);
}
.mixer-mode-btn .mode-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: all 0.2s;
}
.mixer-mode-btn.active .mode-dot {
    background: var(--sc-primary);
    box-shadow: 0 0 8px rgba(229,9,20,0.6);
}

/* ── Step 1: Signal Input ── */
.signal-input-wrap {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.25s, box-shadow 0.25s;
}
.signal-input-wrap:focus-within {
    border-color: rgba(229,9,20,0.3);
    box-shadow: 0 0 0 2px rgba(229,9,20,0.06), 0 0 20px rgba(229,9,20,0.04);
}
.signal-input-wrap::before {
    content: 'INPUT';
    position: absolute;
    top: 8px;
    right: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.1);
    z-index: 1;
    pointer-events: none;
}
.signal-textarea {
    width: 100%;
    min-height: 140px;
    background: transparent;
    border: none;
    padding: 1rem;
    padding-right: 3.5rem;
    color: var(--sc-text);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.88rem;
    line-height: 1.65;
    resize: vertical;
    outline: none;
}
.signal-textarea::placeholder {
    color: rgba(255,255,255,0.15);
}
.signal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.75rem;
    background: rgba(0,0,0,0.15);
    border-top: 1px solid rgba(255,255,255,0.03);
}
.char-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--sc-text-muted);
    transition: color 0.2s;
}
.char-count.near-limit { color: #eab308; }
.char-count.at-limit { color: var(--sc-danger); }
.signal-level {
    display: flex;
    gap: 2px;
    align-items: flex-end;
}
.signal-bar {
    width: 3px;
    border-radius: 1px;
    background: rgba(229,9,20,0.2);
    transition: height 0.3s, background 0.3s;
}
.signal-bar.lit { background: var(--sc-primary); box-shadow: 0 0 4px rgba(229,9,20,0.3); }
.signal-bar.mid { background: #eab308; box-shadow: 0 0 4px rgba(234,179,8,0.3); }
.signal-bar.hot { background: var(--sc-danger); box-shadow: 0 0 4px rgba(239,68,68,0.3); }

/* ── Step 1: Processing Mode ── */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 5px;
    padding: 3px;
}
.mode-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0.55rem 0.25rem;
    border-radius: 3px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--sc-text-muted);
    font-family: 'Chakra Petch', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    text-align: center;
}
.mode-option:hover {
    background: rgba(255,255,255,0.03);
    color: var(--sc-text);
}
.mode-option.active {
    background: rgba(229,9,20,0.12);
    border-color: rgba(229,9,20,0.3);
    color: var(--sc-primary-light);
}
.mode-option-icon { font-size: 1rem; line-height: 1; }
.mode-option-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
}

/* ── Step 1: Gauge ── */
.gauge-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.65rem;
}
.gauge-label-text {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.25);
    white-space: nowrap;
}
.gauge-track {
    flex: 1;
    height: 5px;
    background: rgba(0,0,0,0.35);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.04);
}
.gauge-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.22,1,0.36,1), background 0.4s;
}
.gauge-level-0 { background: rgba(255,255,255,0.15); }
.gauge-level-1 { background: rgba(59, 130, 246, 0.7); }
.gauge-level-2 { background: rgba(217, 119, 6, 0.8); }
.gauge-level-3 {
    background: var(--sc-primary);
    box-shadow: 0 0 8px rgba(229,9,20,0.3);
}
.gauge-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--sc-text-muted);
    white-space: nowrap;
    min-width: 28px;
    text-align: right;
}
.gauge-desc {
    font-size: 0.68rem;
    color: var(--sc-text-muted);
    margin-top: 0.3rem;
}

/* ── Step 1: REC Button ── */
.rec-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.08);
    background: var(--channel-bg, rgba(0,0,0,0.25));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    flex-shrink: 0;
}
.rec-btn:hover { border-color: rgba(229,9,20,0.3); }
.rec-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(229,9,20,0.25);
    border: 2px solid rgba(229,9,20,0.3);
    transition: all 0.25s;
}
.rec-btn:hover .rec-dot {
    background: rgba(229,9,20,0.4);
    border-color: rgba(229,9,20,0.5);
}
.rec-btn.recording {
    border-color: rgba(229,9,20,0.5);
    box-shadow: 0 0 20px rgba(229,9,20,0.15);
}
.rec-btn.recording .rec-dot {
    background: var(--sc-primary);
    border-color: var(--sc-primary-light);
    box-shadow: 0 0 12px rgba(229,9,20,0.5);
    animation: rec-pulse 1.2s ease-in-out infinite;
}
@keyframes rec-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(229,9,20,0.5); }
    50% { box-shadow: 0 0 20px rgba(229,9,20,0.7), 0 0 40px rgba(229,9,20,0.2); }
}
.rec-label {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.48rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    transition: color 0.2s;
}
.rec-btn:not(.recording) .rec-label { color: rgba(255,255,255,0.25); }
.rec-btn.recording .rec-label { color: var(--sc-primary-light); }
.recording-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(229,9,20,0.06);
    border: 1px solid rgba(229,9,20,0.15);
    border-radius: 4px;
    margin-top: 0.75rem;
}
.rec-ring {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sc-primary);
    animation: rec-blink 1s steps(1) infinite;
}
@keyframes rec-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}
.rec-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--sc-primary-light);
}

/* ── Step 1: Continue Button ── */
.continue-btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border: 1px solid rgba(229,9,20,0.4);
    border-radius: 6px;
    background: linear-gradient(160deg, var(--sc-primary-highlight), var(--sc-primary), var(--sc-primary) 80%);
    color: #fff;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow:
        0 0 20px rgba(229,9,20,0.15),
        0 4px 12px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}
.continue-btn:hover {
    box-shadow:
        0 0 30px rgba(229,9,20,0.25),
        0 0 60px rgba(229,9,20,0.1),
        0 4px 16px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}
.continue-btn:active { transform: translateY(0); }
.continue-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    animation: btn-shimmer 4s ease-in-out infinite;
}
@keyframes btn-shimmer {
    0% { transform: translateX(-30%); }
    100% { transform: translateX(30%); }
}

/* ── Step 2: Structure ── */
.structure-row {
    display: flex;
    gap: 1.25rem;
    align-items: flex-end;
}
.fader-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}
.fader-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sc-text-muted);
}
.fader-track {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.fader-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(217,119,6,0.3);
    min-width: 24px;
    text-align: center;
}
.led-seg {
    width: 52px;
    height: 20px;
    border-radius: 3px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255,255,255,0.12);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.led-seg:hover {
    border-color: rgba(217,119,6,0.3);
    background: rgba(217,119,6,0.08);
}
.led-seg.lit {
    background: rgba(217,119,6,0.3);
    border-color: rgba(217,119,6,0.5);
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(217,119,6,0.15);
}
.led-seg.lit.peak {
    background: rgba(217,119,6,0.45);
    box-shadow: 0 0 14px rgba(217,119,6,0.25);
}
/* Chorus (blue) fader */
.fader-chorus .led-seg:hover { border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.08); }
.fader-chorus .led-seg.lit { background: rgba(59,130,246,0.3); border-color: rgba(59,130,246,0.5); color: #93c5fd; box-shadow: 0 0 10px rgba(59,130,246,0.15); }
.fader-chorus .led-seg.lit.peak { background: rgba(59,130,246,0.45); box-shadow: 0 0 14px rgba(59,130,246,0.25); }
.fader-chorus .fader-value { color: #60a5fa; text-shadow: 0 0 12px rgba(59,130,246,0.3); }
.fader-chorus .fader-label { color: #60a5fa; }
/* Bridge (teal) fader */
.fader-bridge .led-seg:hover { border-color: rgba(20,184,166,0.3); background: rgba(20,184,166,0.08); }
.fader-bridge .led-seg.lit { background: rgba(20,184,166,0.3); border-color: rgba(20,184,166,0.5); color: #99f6e4; box-shadow: 0 0 10px rgba(20,184,166,0.15); }
.fader-bridge .led-seg.lit.peak { background: rgba(20,184,166,0.45); box-shadow: 0 0 14px rgba(20,184,166,0.25); }
.fader-bridge .fader-value { color: #5eead4; text-shadow: 0 0 12px rgba(20,184,166,0.3); }
.fader-bridge .fader-label { color: #5eead4; }

/* ── Step 2: Flip Switch ── */
.toggle-group {
    display: flex;
    gap: 1.25rem;
    margin-left: auto;
}
.flip-switch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    cursor: pointer;
    user-select: none;
}
.flip-switch-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.25);
    margin-bottom: 4px;
}
.flip-switch.on .flip-switch-label { color: var(--sc-primary-light); }
.flip-state-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    height: 14px;
    line-height: 14px;
}
.flip-state-on {
    color: rgba(229,9,20,0.25);
    transition: color 0.2s;
}
.flip-switch.on .flip-state-on {
    color: var(--sc-primary-light);
    text-shadow: 0 0 8px rgba(229,9,20,0.4);
}
.flip-state-off {
    color: rgba(255,255,255,0.3);
    transition: color 0.2s;
}
.flip-switch.on .flip-state-off { color: rgba(255,255,255,0.12); }
.flip-track {
    width: 20px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    margin: 3px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.flip-switch:hover .flip-track { border-color: rgba(229,9,20,0.2); }
.flip-switch.on .flip-track {
    border-color: rgba(229,9,20,0.25);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 0 12px rgba(229,9,20,0.08);
}
.flip-handle {
    position: absolute;
    left: 2px;
    right: 2px;
    height: 16px;
    border-radius: 7px;
    transition: top 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, box-shadow 0.2s;
    background: linear-gradient(180deg, #4a4a52, #2e2e36);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
    top: 21px;
}
.flip-switch.on .flip-handle {
    top: 2px;
    background: linear-gradient(180deg, #5a3035, #3a1a1e);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(229,9,20,0.15), 0 0 10px rgba(229,9,20,0.1);
}
.flip-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 1px;
    background: rgba(255,255,255,0.12);
    box-shadow: 0 -3px 0 rgba(255,255,255,0.08), 0 3px 0 rgba(255,255,255,0.08);
}
/* Chorus (blue) flip switch */
.flip-chorus.on .flip-switch-label { color: #93c5fd; }
.flip-chorus.on .flip-state-on { color: #60a5fa; text-shadow: 0 0 8px rgba(59,130,246,0.4); }
.flip-chorus:hover .flip-track { border-color: rgba(59,130,246,0.2); }
.flip-chorus.on .flip-track { border-color: rgba(59,130,246,0.25); box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 0 12px rgba(59,130,246,0.08); }
.flip-chorus.on .flip-handle { background: linear-gradient(180deg, #2a3a5a, #1a2640); box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(59,130,246,0.15), 0 0 10px rgba(59,130,246,0.1); }
/* Bridge (teal) flip switch */
.flip-bridge.on .flip-switch-label { color: #99f6e4; }
.flip-bridge.on .flip-state-on { color: #5eead4; text-shadow: 0 0 8px rgba(20,184,166,0.4); }
.flip-bridge:hover .flip-track { border-color: rgba(20,184,166,0.2); }
.flip-bridge.on .flip-track { border-color: rgba(20,184,166,0.25); box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 0 12px rgba(20,184,166,0.08); }
.flip-bridge.on .flip-handle { background: linear-gradient(180deg, #1a4a42, #0e3028); box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(20,184,166,0.15), 0 0 10px rgba(20,184,166,0.1); }

/* ── Step 2: Structure Blueprint ── */
.structure-blueprint {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.04);
    flex: 1;
    min-width: 60px;
    max-width: 120px;
    align-self: stretch;
}
.bp-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 1px 4px;
    border-radius: 3px;
    flex: 1;
    min-height: 0;
}
.bp-label {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    width: 16px;
    flex-shrink: 0;
    text-align: right;
}
.bp-lines {
    display: flex;
    gap: 2px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}
.bp-line {
    height: 6px;
    flex: 1;
    border-radius: 3px;
    min-width: 6px;
}
.bp-verse { background: rgba(217,119,6,0.1); }
.bp-verse .bp-label { color: #d97706; }
.bp-verse .bp-line { background: #d97706; opacity: 0.5; }
.bp-chorus { background: rgba(59,130,246,0.08); }
.bp-chorus .bp-label { color: #60a5fa; }
.bp-chorus .bp-line { background: #3b82f6; opacity: 0.5; }
.bp-bridge { background: rgba(20,184,166,0.08); }
.bp-bridge .bp-label { color: #5eead4; }
.bp-bridge .bp-line { background: #14b8a6; opacity: 0.5; }

/* ── Step 2: Capacity Meter ── */
.capacity-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.85rem;
}
.capacity-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sc-text-muted);
    white-space: nowrap;
}
.capacity-track {
    flex: 1;
    height: 6px;
    background: rgba(0,0,0,0.35);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.04);
}
.capacity-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.22,1,0.36,1), background 0.4s;
}
.capacity-fill.ok { background: linear-gradient(90deg, #22c55e, #4ade80); }
.capacity-fill.warn { background: linear-gradient(90deg, #22c55e, #eab308, #f59e0b); }
.capacity-fill.danger { background: linear-gradient(90deg, #eab308, #ef4444, #dc2626); }
.capacity-chars {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--sc-text-muted);
    white-space: nowrap;
}

/* ── Step 2: Pill Selector ── */
.pill-row-container {
    position: relative;
    margin-bottom: 0.65rem;
}
.pill-row-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.4rem;
}
.pill-row-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.pill-row-label-row .pill-row-label {
    margin-bottom: 0;
}
.pill-filter-input {
    font-size: 0.6rem;
    padding: 2px 8px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.7);
    outline: none;
    width: 80px;
    transition: border-color 0.2s, width 0.2s;
}
.pill-filter-input:focus {
    border-color: rgba(229,9,20,0.4);
    width: 110px;
}
.pill-filter-input::placeholder {
    color: rgba(255,255,255,0.2);
}
.pill-scroll-wrap.filtering::before,
.pill-scroll-wrap.filtering::after {
    display: none;
}
.pill-scroll.pill-scroll-wrap-mode {
    flex-wrap: wrap;
    overflow-x: visible;
}
.pill-scroll-wrap {
    position: relative;
    overflow: hidden;
}
.pill-scroll-wrap::before,
.pill-scroll-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.2s;
}
.pill-scroll-wrap::before {
    left: 0;
    background: linear-gradient(90deg, var(--panel-bg, #111118), transparent);
    opacity: 0;
}
.pill-scroll-wrap.scrolled-start::before { opacity: 1; }
.pill-scroll-wrap::after {
    right: 0;
    background: linear-gradient(-90deg, var(--panel-bg, #111118), transparent);
}
.pill-scroll-wrap.scrolled-end::after { opacity: 0; }
.pill-scrollbar {
    height: 3px;
    margin-top: 6px;
    background: rgba(255,255,255,0.04);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.pill-scrollbar-thumb {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 2px;
    background: rgba(229,9,20,0.35);
    transition: left 0.1s ease-out, width 0.1s ease-out;
    box-shadow: 0 0 6px rgba(229,9,20,0.15);
}
.pill-scroll {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 3px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}
.pill-scroll::-webkit-scrollbar { display: none; }
.mixer-pill {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.25);
    color: var(--sc-text-muted);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    user-select: none;
}
.mixer-pill:hover {
    border-color: rgba(229,9,20,0.25);
    color: var(--sc-text);
    background: rgba(229,9,20,0.05);
}
.mixer-pill.active {
    background: rgba(229,9,20,0.15);
    border-color: rgba(229,9,20,0.45);
    color: var(--sc-primary-light);
    box-shadow: 0 0 10px rgba(229,9,20,0.15);
}

/* ── Step 2: Selector Buttons ── */
.selector-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.07);
    background: var(--channel-bg, rgba(0,0,0,0.25));
    color: var(--sc-text-muted);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.selector-btn:hover {
    border-color: rgba(229,9,20,0.2);
    color: var(--sc-text);
}
.selector-btn.active {
    background: rgba(229,9,20,0.12);
    border-color: rgba(229,9,20,0.4);
    color: var(--sc-primary-light);
}
.selector-btn .sel-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    transition: all 0.2s;
}
.selector-btn.active .sel-dot {
    background: var(--sc-primary);
    box-shadow: 0 0 6px rgba(229,9,20,0.5);
}
.tempo-bpm {
    font-size: 0.55rem;
    opacity: 0.45;
    font-weight: 400;
}

/* ── Step 2: Style Input ── */
.style-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 4px;
    padding: 0.55rem 0.75rem;
    color: var(--sc-text);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.style-input::placeholder { color: rgba(255,255,255,0.2); }
.style-input:focus {
    border-color: rgba(229,9,20,0.35);
    box-shadow: 0 0 0 2px rgba(229,9,20,0.08);
}

/* ── Step 2: Language Select ── */
.lang-select {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 4px;
    padding: 0.4rem 0.65rem;
    color: var(--sc-text);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.72rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b8b96'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}
.lang-select:focus { border-color: rgba(229,9,20,0.35); }

/* ── Step 2: Engine Grid ── */
.engine-grid {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.engine-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.engine-group-label {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.25);
}

/* ── Step 2: Generate Button ── */
.generate-btn {
    width: 100%;
    padding: 0.85rem 2rem;
    border: 1px solid rgba(229,9,20,0.4);
    border-radius: 6px;
    background: linear-gradient(160deg, var(--sc-primary-highlight), var(--sc-primary), var(--sc-primary) 80%);
    color: #fff;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow:
        0 0 20px rgba(229,9,20,0.15),
        0 4px 12px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}
.generate-btn:hover {
    box-shadow:
        0 0 30px rgba(229,9,20,0.25),
        0 0 60px rgba(229,9,20,0.1),
        0 4px 16px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}
.generate-btn:active {
    transform: translateY(0);
    box-shadow:
        0 0 15px rgba(229,9,20,0.2),
        0 2px 8px rgba(0,0,0,0.3);
}
.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    animation: btn-shimmer 4s ease-in-out infinite;
}

/* ── Mixer: Sub-labels ── */
.sub-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.sub-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.25);
    white-space: nowrap;
}

/* ── Mixer: Structure Disabled State ── */
.structure-section {
    transition: opacity 0.3s, filter 0.3s;
}
.structure-section.disabled {
    opacity: 0.25;
    filter: grayscale(1);
    pointer-events: none;
}

/* ── Mixer: Idea Echo ── */
.idea-echo {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 0.6rem 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
    color: var(--sc-text-muted);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.idea-echo i { color: rgba(229,9,20,0.4); margin-top: 1px; flex-shrink: 0; }

/* ── Mixer: Responsive ── */
@media (max-width: 600px) {
    .rack-panel { padding: 1.5rem 1rem 1.25rem; }
    .mode-selector { grid-template-columns: repeat(2, 1fr); }
    .signal-textarea { min-height: 120px; font-size: 0.85rem; }
    .structure-row { gap: 0.75rem; flex-wrap: wrap; }
    .fader-channel { flex: 0 0 auto; }
    .toggle-group { margin-left: 0; }
    .led-seg { width: 44px; height: 18px; font-size: 0.6rem; }
    .toggle-group { gap: 1rem; }
    .engine-grid { gap: 1rem; }
    .selector-btn { font-size: 0.68rem; padding: 0.4rem 0.7rem; }
}
@media (max-width: 380px) {
    .rack-panel { padding: 1.25rem 0.75rem 1rem; }
    .mode-option { padding: 0.45rem 0.2rem; }
    .mode-option-label { font-size: 0.52rem; }
    .mixer-pill { font-size: 0.68rem; padding: 4px 10px; }
}

/* ============================================================
   Responsive - Tablet (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    .string-field { height: 140px; }
    .floating-notes span { font-size: 1rem !important; }
    .hero-viz-section { min-height: 380px; padding: 2rem 0; }

    .create-step { padding: 1.25rem; }
    .create-option-grid { grid-template-columns: repeat(2, 1fr); }
    .create-option-grid.two-col { grid-template-columns: repeat(2, 1fr); }
    .create-header-title { font-size: 1.3rem; }

    .create-final-actions { flex-direction: column; }
    .create-final-actions .btn { width: 100%; }

    .feature-card { padding: 1.25rem 1rem; }

    .footer-links { flex-wrap: wrap; justify-content: center; }

    .generating-radial-viz { width: 90px; height: 90px; }

    /* Mobile nav dropdown */
    .navbar-collapse {
        background: rgba(12, 12, 16, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--sc-glass-border);
        border-radius: 12px;
        padding: 0.75rem;
        margin-top: 0.5rem;
    }
    .nav-pills-glass {
        gap: 0.25rem;
    }
    .nav-pill {
        width: 100%;
        border-radius: 8px !important;
        padding: 0.6rem 0.75rem !important;
        background: transparent;
        border-color: transparent;
    }
    .nav-pill:hover {
        background: rgba(var(--sc-accent-rgb), 0.08);
        border-color: transparent;
        box-shadow: none;
        transform: none;
    }
    .nav-pill-muted {
        opacity: 0.7;
    }
}

/* ============================================================
   Responsive - Phone (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    /* Layout & spacing */
    .create-step { padding: 0.875rem; }
    .container { padding-left: 0.75rem; padding-right: 0.75rem; }

    /* String field & floating notes */
    .string-field { height: 80px; }
    .floating-notes span { font-size: 0.8rem !important; }
    .hero-viz-section { min-height: 320px; padding: 1.5rem 0; }

    /* Player hero */
    .player-hero { border-radius: 12px; }
    .player-hero-play { width: 48px; height: 48px; font-size: 1.2rem; }

    /* Progress bar - bigger touch target on mobile */
    .progress-track { height: 6px; }
    .progress-track::before { top: -14px; bottom: -14px; }

    /* Card touch targets */
    .card-radial-play { width: 44px; height: 44px; font-size: 1rem; }
    .card-play-btn { width: 44px; height: 44px; min-width: 44px; font-size: 1rem; }
    .card-player-action { width: 36px; height: 36px; font-size: 0.9rem; }

    /* Card cover image */
    .card-cover-img { aspect-ratio: 16 / 9; height: auto; }

    /* Share controls */
    .share-link-row { flex-direction: column; }
    .share-link-row .form-control { font-size: 0.75rem; }

    /* Modal */
    .sc-modal-dialog { padding: 1.5rem 1.25rem; }

    /* Footer */
    .footer-links { flex-direction: column; gap: 0.4rem; }
    .footer-dot { display: none; }

    /* Feature cards */
    .feature-card { padding: 1rem; }
    .feature-card h5 { font-size: 1rem; }

    /* Generating ring */
    .generating-ring { width: 60px; height: 60px; }
    .generating-ring-inner { width: 40px; height: 40px; font-size: 1rem; }
    .generating-radial-viz { width: 70px; height: 70px; }

    /* Create actions - stack on small phones */
    .create-actions { flex-direction: column; }
    .create-actions .btn { width: 100%; }
    .create-actions .htmx-indicator { justify-content: center; }

    /* Textarea */
    .create-textarea { font-size: 0.9rem; }
}

/* ============================================================
   Confirm Modal - Glassy
   ============================================================ */

.sc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sc-modal-dialog {
    background: var(--sc-glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--sc-glass-border);
    border-radius: 1rem;
    padding: 2rem 2.5rem;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.sc-modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.12);
    color: #f87171;
    font-size: 1.25rem;
}

.sc-modal-title {
    color: var(--sc-text);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sc-modal-text {
    color: var(--sc-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.sc-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.sc-modal-btn-cancel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--sc-text);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}
.sc-modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sc-text);
}

.sc-modal-btn-danger {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #f87171;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}
.sc-modal-btn-danger:hover {
    background: rgba(220, 53, 69, 0.35);
    color: #fca5a5;
}

/* --- Reference image upload --- */
.ref-image-preview {
    max-width: 120px;
    max-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--sc-glass-border);
}

.form-control[type="file"] {
    padding: 0;
    overflow: hidden;
}
.form-control[type="file"]::file-selector-button {
    background: rgba(var(--sc-accent-rgb), 0.12);
    border: none;
    border-right: 1px solid rgba(139, 139, 150, 0.2);
    color: var(--sc-primary-light);
    font-weight: 500;
    font-size: 0.82rem;
    padding: 0.45rem 1rem;
    margin-right: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}
.form-control[type="file"]::file-selector-button:hover {
    background: rgba(var(--sc-accent-rgb), 0.22);
}

/* --- Like button --- */
.btn-outline-like {
    color: var(--sc-text-muted);
    border: 1px solid rgba(139, 139, 150, 0.25);
    background: rgba(139, 139, 150, 0.04);
    border-radius: 999px;
    transition: all 0.25s ease;
    font-size: 0.82rem;
}
.btn-outline-like:hover {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
    transform: translateY(-1px);
}
.btn-like-active {
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 999px;
    transition: all 0.25s ease;
    font-size: 0.82rem;
}
.btn-like-active:hover {
    color: var(--sc-text-muted);
    border-color: rgba(139, 139, 150, 0.25);
    background: rgba(139, 139, 150, 0.04);
    transform: translateY(-1px);
}
.like-count {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

/* --- Rating stars --- */
.rating-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
}
.rating-stars .rating-star {
    font-size: 1.1rem;
    color: var(--sc-text-muted);
    line-height: 1;
    text-decoration: none;
    transition: color 0.15s;
    cursor: pointer;
}
.rating-stars .rating-star.rated {
    color: var(--sc-primary-light);
}
.rating-stars:hover .rating-star.rated {
    color: var(--sc-text-muted);
}
.rating-stars .rating-star:hover,
.rating-stars .rating-star:hover ~ .rating-star {
    color: var(--sc-primary-highlight);
}

/* Variation Picker */
.variation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.variation-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sc-glass-border);
    border-radius: 12px;
    padding: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.variation-card:hover {
    border-color: rgba(var(--sc-accent-rgb), 0.3);
}
.variation-failed {
    opacity: 0.5;
}
.variation-pending {
    opacity: 0.7;
}
.variation-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sc-primary-light);
    background: rgba(var(--sc-accent-rgb), 0.1);
    border: 1px solid rgba(var(--sc-accent-rgb), 0.2);
    border-radius: 6px;
    padding: 0.15rem 0.6rem;
    margin-bottom: 0.75rem;
}
.variation-player {
    width: 100%;
}
.variation-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.variation-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.variation-cover-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--sc-accent-rgb), 0.15), rgba(139, 92, 246, 0.15));
}
.variation-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.variation-play-btn:hover {
    background: rgba(var(--sc-accent-rgb), 0.7);
    transform: translate(-50%, -50%) scale(1.1);
}
.variation-play-btn.active {
    background: var(--sc-primary);
}
.variation-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.variation-progress .progress-track {
    flex: 1;
}
.variation-status-icon {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.variation-spinner {
    width: 64px;
    height: 64px;
}
.variation-spinner canvas {
    width: 100%;
    height: 100%;
}
@media (max-width: 575.98px) {
    .variation-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .variation-cover-wrap {
        aspect-ratio: 16/9;
    }
}
@media (min-width: 576px) and (max-width: 767.98px) {
    .variation-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .variation-card {
        padding: 0.75rem;
    }
}

/* Transitions */
.sc-modal-enter { transition: opacity 0.2s ease-out; }
.sc-modal-enter-from { opacity: 0; }
.sc-modal-enter-to { opacity: 1; }
.sc-modal-leave { transition: opacity 0.15s ease-in; }
.sc-modal-leave-from { opacity: 1; }
.sc-modal-leave-to { opacity: 0; }

/* Discover page */
.discover-genre-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.discover-genre-tabs .badge {
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.discover-genre-tabs .badge:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}
.discover-genre-tabs .badge.bg-primary {
    background-color: var(--sc-primary) !important;
    color: #fff;
}

/* ═══ Back Step Button ═══ */
.back-step-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(139, 139, 150, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: var(--sc-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    margin-right: 0.35rem;
    flex-shrink: 0;
}
.back-step-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--sc-text);
    border-color: rgba(139, 139, 150, 0.25);
}
.back-step-btn i {
    font-size: 0.8rem;
}

/* ═══ Song Map (Lyrics Editor) ═══ */
.song-map {
    margin-bottom: 1rem;
}
.song-map-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sc-text-muted);
    margin-bottom: 0.4rem;
    opacity: 0.7;
}
.song-map-flow {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.song-map-block {
    position: relative;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: color-mix(in srgb, var(--block-color) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--block-color) 30%, transparent);
    cursor: default;
    transition: all 0.15s ease;
}
.song-map-block:hover {
    background: color-mix(in srgb, var(--block-color) 25%, transparent);
}
.song-map-block-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--block-color);
    white-space: nowrap;
}
.song-map-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 28, 0.95);
    color: var(--sc-text-muted);
    font-size: 0.68rem;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid rgba(139, 139, 150, 0.15);
    pointer-events: none;
    z-index: 10;
}
.song-map-block:hover .song-map-tooltip {
    display: block;
}

/* ═══ Styled Lyrics (Read-Only Views) ═══ */
.styled-lyrics {
    background: rgba(12, 12, 16, 0.4);
    border: 1px solid rgba(139, 139, 150, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 0.5rem;
}
.styled-lyrics-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--section-color) 20%, transparent);
}
.styled-lyrics-section:first-child {
    margin-top: 0;
}
.styled-lyrics-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--section-color);
    white-space: nowrap;
}
.styled-lyrics-desc {
    font-size: 0.65rem;
    color: var(--sc-text-muted);
    opacity: 0.6;
    white-space: nowrap;
}
.styled-lyrics-line {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--sc-text-muted);
    white-space: pre-wrap;
}
