        /* Admin pages scroll normally — override full-screen app shell */
        html, body {
            height: auto;
            overflow: auto;
            font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: var(--bg);
            color: var(--text-1);
        }
        body {
            min-height: 100vh;
        }

        body {
            padding: 0;
            margin: 0;
        }

        .admin-page-wrap {
            max-width: 1200px;
            margin: 0 auto;
            padding: 24px 20px;
        }

        /* Dashboard content area */
        #dashboard > *:not(.admin-header) {
            max-width: 1200px;
            margin-left: auto;
            margin-right: auto;
        }

        #dashboard {
            padding: 0;
        }

        #dashboard > .admin-header {
            position: sticky;
            top: 0;
            z-index: 100;
        }

        /* Wrap non-header dashboard content */
        #dashboard > *:not(.admin-header) {
            padding-left: 20px;
            padding-right: 20px;
        }

        #dashboard > .tab-nav-outer {
            padding-top: 20px;
        }

        .admin-header {
            background: linear-gradient(180deg, #090F1E 0%, #1E2A42 100%);
            color: #fff;
            padding: 14px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0;
        }

        .admin-header h1 {
            font-family: 'Montserrat', sans-serif;
            font-size: 18px;
            font-weight: 800;
            color: #fff;
            margin: 0;
        }

        .admin-header .btn {
            background: rgba(255,255,255,0.15);
            border: 1.5px solid rgba(255,255,255,0.28);
            color: #fff;
            font-size: 0.85rem;
            min-height: 42px;
        }

        .admin-header .btn:hover {
            background: rgba(255,255,255,0.25);
        }

        .admin-header-icon-btn {
            width: 42px;
            padding: 0;
            line-height: 1;
            flex-shrink: 0;
        }

        .admin-header-icon-btn .lucide {
            width: 18px;
            height: 18px;
        }

        /* Account panel */
        .account-menu-panel .btn-primary {
            background: var(--primary-color);
            color: #090F1E;
            border: none;
        }
        .account-menu-panel .btn-primary:hover {
            opacity: 0.88;
        }

        .card {
            background: var(--surface);
            padding: 20px;
            border-radius: 14px;
            margin-bottom: 20px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border);
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
            color: var(--text-1);
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: 10px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            color: var(--text-1);
            box-sizing: border-box;
        }

        .btn {
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            border: none;
            font-weight: bold;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }

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

        .btn-sm {
            padding: 5px 10px;
            font-size: var(--text-sm);
        }

        .project-action-bar,
        .table-action-group.table-action-group--icons {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: nowrap;
        }

        .project-action-btn {
            width: 36px;
            height: 36px;
            padding: 0;
            border-radius: 8px;
            flex-shrink: 0;
        }

        .project-action-btn .lucide {
            width: 16px;
            height: 16px;
        }

        .project-action-btn-danger {
            background: transparent;
            color: var(--error);
            border-color: var(--error);
        }

        .project-action-btn-danger:hover {
            background: var(--error-bg);
        }

        .content-tab-btn {
            padding: 8px 16px;
            background: transparent;
            border: none;
            border-bottom: 3px solid transparent;
            font-weight: 600;
            font-size: 14px;
            color: var(--text-secondary);
            cursor: pointer;
            margin-bottom: -2px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .content-tab-btn.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
        }
        .content-tab-btn:hover:not(.active) {
            color: var(--text-color);
        }

        .btn-primary {
            background: var(--primary-color);
            color: #090F1E;
        }

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

        .songs-toolbar {
            display: flex;
            gap: 12px;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }

        .songs-toolbar-main {
            display: grid;
            grid-template-columns: minmax(280px, 1fr) auto;
            flex: 1 1 460px;
            min-width: 320px;
            align-items: stretch;
            gap: 12px;
        }

        .songs-toolbar-search-wrap {
            min-width: 240px;
            display: flex;
            align-items: stretch;
            min-height: 62px;
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
            box-shadow: var(--shadow-sm);
        }

        input.songs-toolbar-search,
        select.songs-toolbar-select {
            display: block;
            width: 100%;
            box-sizing: border-box;
            font: inherit;
            min-height: 44px;
            height: 44px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text-1);
            font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            font-size: 0.95rem;
            font-weight: 700;
            line-height: 1.2;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
            transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
        }

        input.songs-toolbar-search {
            max-width: 100%;
            padding: 0 14px;
        }

        input.songs-toolbar-search::placeholder {
            color: var(--text-2);
            font-weight: 600;
        }

        select.songs-toolbar-select {
            width: auto;
            min-width: 170px;
            padding: 0 40px 0 14px;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image:
                linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                linear-gradient(135deg, var(--accent) 50%, transparent 50%);
            background-position:
                calc(100% - 20px) calc(50% - 2px),
                calc(100% - 14px) calc(50% - 2px);
            background-size: 6px 6px, 6px 6px;
            background-repeat: no-repeat;
        }

        .songs-toolbar-select-project,
        .songs-bulk-project-select {
            min-width: 200px;
        }

        input.songs-toolbar-search:focus,
        select.songs-toolbar-select:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-tint);
            background: var(--surface);
        }

        .songs-toolbar-sort {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            min-height: 62px;
            padding: 8px 12px;
            border-radius: 12px;
            background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(245, 246, 248, 0.98) 100%);
            border: 1px solid rgba(217, 119, 6, 0.18);
            box-shadow: var(--shadow-sm);
        }

        .songs-toolbar-label {
            font-family: 'Montserrat', sans-serif;
            font-size: 0.74rem;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--accent-dark);
            white-space: nowrap;
        }

        .songs-bulk-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            padding: 8px 10px;
            border-radius: 12px;
            background: var(--surface);
            border: 1px solid var(--border);
            min-height: 62px;
        }

        .songs-bulk-count {
            font-size: var(--text-sm);
            font-weight: 700;
            color: var(--text-2);
            white-space: nowrap;
            margin-right: 2px;
        }

        @media (max-width: 900px) {
            .songs-toolbar {
                align-items: stretch;
            }

            .songs-toolbar-main {
                display: flex;
                flex-wrap: wrap;
                min-width: 0;
                width: 100%;
            }
        }

        @media (max-width: 640px) {
            .songs-toolbar-main,
            .songs-toolbar-sort,
            .songs-bulk-bar {
                width: 100%;
                min-width: 0;
            }

            .songs-toolbar-select,
            .songs-toolbar-select-project,
            .songs-bulk-project-select {
                min-width: 0;
                width: 100%;
            }

            .songs-toolbar-search-wrap {
                min-width: 0;
                width: 100%;
            }
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th,
        td {
            text-align: left;
            padding: 12px;
            border-bottom: 1px solid var(--border-color);
        }

        tr:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        .modal.visible {
            display: flex;
        }

        .modal-content {
            background: var(--surface-color);
            padding: 30px;
            border-radius: 16px;
            width: 90%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
        }

        #song-content-modal {
            align-items: flex-start;
            padding: 24px 0;
        }

        .song-content-modal-content {
            width: min(1180px, calc(100vw - 40px));
            max-width: 1180px;
            max-height: calc(100vh - 48px);
        }

        .project-modal-content {
            width: min(1180px, calc(100vw - 40px));
            max-width: 1180px;
            max-height: calc(100vh - 48px);
        }

        .song-content-modal-head {
            gap: 16px;
        }

        .song-content-tab-bar {
            flex-wrap: wrap;
        }

        .upload-area {
            border: 2px dashed var(--border-color);
            padding: 20px;
            text-align: center;
            border-radius: 8px;
            cursor: pointer;
        }

        .upload-area:hover {
            border-color: var(--primary-color);
        }

        #login-overlay {
            position: fixed;
            inset: 0;
            background: var(--bg-color);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .hidden {
            display: none !important;
        }

        /* Typography: 3 levels */
        :root { --text-lg: 1.1rem; --text-sm: 0.875rem; }
        h2 { font-size: var(--text-lg); font-weight: 700; margin: 0 0 16px; }
        h3 { font-size: 1rem; font-weight: 700; margin: 0 0 8px; }

        .audio-sub-tab-nav {
            display: flex;
            border-bottom: 2px solid var(--border);
            margin-bottom: 0;
        }
        .audio-sub-tab-btn {
            padding: 7px 14px;
            background: none;
            border: none;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .audio-sub-tab-btn.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
        }
        .audio-sub-tab-btn:hover:not(.active) {
            color: var(--text-color);
        }
        .audio-sub-tab-panel {
            padding-top: 14px;
        }
        .audio-source-picker {
            margin-bottom: 18px;
            padding: 16px;
            border: 1px solid var(--border);
            border-radius: 14px;
            background:
                radial-gradient(circle at top right, rgba(255,152,0,0.12), transparent 36%),
                linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 88%, var(--surface-2) 12%));
        }
        .audio-source-picker-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }
        .audio-source-picker-title {
            display: block;
            font-size: 15px;
            margin-bottom: 4px;
        }
        .audio-source-picker-hint {
            display: block;
            color: var(--text-secondary);
            line-height: 1.5;
        }
        .audio-source-selector {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 10px;
        }
        .audio-source-card {
            width: 100%;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            text-align: left;
            padding: 14px 15px;
            border-radius: 14px;
            border: 1px solid var(--border);
            background: rgba(255,255,255,0.02);
            color: var(--text-color);
            cursor: pointer;
            transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
        }
        .audio-source-card:hover:not(:disabled) {
            transform: translateY(-1px);
            border-color: color-mix(in srgb, var(--accent) 55%, var(--border) 45%);
            background: color-mix(in srgb, var(--surface) 76%, var(--surface-2) 24%);
            box-shadow: 0 8px 20px rgba(0,0,0,0.12);
        }
        .audio-source-card:disabled {
            opacity: 0.52;
            cursor: not-allowed;
            box-shadow: none;
        }
        .audio-source-card.is-active {
            border-color: var(--accent);
            background: color-mix(in srgb, var(--accent-tint) 65%, var(--surface) 35%);
            box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent 55%);
        }
        .audio-source-card-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 38px;
            height: 38px;
            border-radius: 12px;
            background: rgba(255,255,255,0.06);
            color: var(--accent);
            flex: 0 0 auto;
        }
        .audio-source-card.is-active .audio-source-card-icon {
            background: color-mix(in srgb, var(--accent) 16%, white 84%);
            color: var(--accent);
        }
        .audio-source-card-body {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0;
        }
        .audio-source-card-title {
            font-size: 14px;
            font-weight: 700;
            line-height: 1.3;
        }
        .audio-source-card-text {
            font-size: 12px;
            line-height: 1.45;
            color: var(--text-secondary);
        }
        .audio-source-empty-state {
            display: none;
            margin-bottom: 18px;
            padding: 14px 16px;
            border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border) 55%);
            border-radius: 14px;
            background: color-mix(in srgb, var(--accent-tint) 50%, var(--surface) 50%);
            color: var(--text-secondary);
            line-height: 1.55;
        }
        .audio-source-panel-highlight {
            animation: audio-source-panel-highlight 1.2s ease-out;
        }
        @keyframes audio-source-panel-highlight {
            0% {
                box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 28%, transparent 72%);
                transform: translateY(8px);
            }
            35% {
                box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 12%, transparent 88%);
                transform: translateY(0);
            }
            100% {
                box-shadow: 0 0 0 0 transparent;
                transform: translateY(0);
            }
        }
        /* Unsaved-changes indicator on tab button */
        .content-tab-btn.dirty::after {
            content: ' •';
            color: var(--accent);
        }
        /* Highlight MP3 voice-name inputs that still need a value */
        input.mp3-voice-name:placeholder-shown {
            border-color: var(--accent) !important;
            background: var(--accent-tint);
        }
        .badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: var(--text-sm);
            font-weight: bold;
        }
        .badge-vocal {
            background: rgba(74, 222, 128, 0.15);
            color: #4ade80;
        }
        .badge-instrumental {
            background: rgba(251, 191, 36, 0.15);
            color: #fbbf24;
        }
        #wav-progress-bar-wrap {
            background: var(--border-color);
            border-radius: 6px;
            height: 8px;
            margin: 8px 0 4px;
        }
        #wav-progress-bar {
            height: 8px;
            border-radius: 6px;
            background: var(--primary-color);
            width: 0%;
            transition: width 0.3s;
        }
        .midi-voices-table {
            font-size: 0.82em;
        }
        .midi-voices-table td, .midi-voices-table th {
            padding: 6px 8px;
        }
        .midi-voices-table input[type=text] {
            width: 100%;
            padding: 4px 6px;
            border-radius: 6px;
            border: 1px solid var(--border-color);
            background: var(--bg-color);
            color: var(--text-color);
            box-sizing: border-box;
        }
        .youtube-track-field {
            width: 100%;
            min-height: 42px;
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid var(--border);
            background: var(--surface-2);
            color: var(--text-1);
            box-sizing: border-box;
            font: inherit;
            transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
        }
        .youtube-track-field::placeholder {
            color: var(--text-2);
        }
        .youtube-track-field:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-tint);
            background: var(--surface);
        }
        .youtube-track-select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            padding-right: 40px;
            background-image:
                linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                linear-gradient(135deg, var(--accent) 50%, transparent 50%);
            background-position:
                calc(100% - 20px) calc(50% - 2px),
                calc(100% - 14px) calc(50% - 2px);
            background-size: 6px 6px, 6px 6px;
            background-repeat: no-repeat;
        }
        .admin-source-sections {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .admin-source-section {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 12px 14px;
        }
        .admin-source-section-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 10px;
        }
        .admin-source-title-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 4px;
            font-size: 14px;
        }
        .admin-source-meta {
            color: var(--text-secondary);
            font-size: 12px;
            line-height: 1.45;
        }
        .admin-source-pill {
            display: inline-flex;
            align-items: center;
            font-size: 11px;
            padding: 3px 8px;
            border-radius: 999px;
            font-weight: 600;
        }
        .admin-source-pill-youtube {
            background: rgba(255, 0, 0, 0.08);
            color: #c62828;
        }
        .admin-source-pill-upload {
            background: rgba(255, 152, 0, 0.10);
            color: #b26a00;
        }
        .admin-source-pill-midi {
            background: rgba(33, 150, 243, 0.12);
            color: #1565c0;
        }
        .admin-source-table-wrap {
            overflow-x: auto;
        }
        .admin-source-table {
            margin-bottom: 0;
        }
        .admin-source-table th,
        .admin-source-table td {
            padding: 8px 10px;
            vertical-align: top;
        }
        .admin-source-table td {
            font-size: 14px;
        }
        .admin-source-table th {
            font-size: 12px;
            color: var(--text-secondary);
            font-weight: 600;
        }
        .admin-source-primary {
            font-weight: 600;
            white-space: nowrap;
        }
        .admin-source-muted {
            color: var(--text-secondary);
            white-space: nowrap;
            font-size: 12px;
        }
        .admin-source-actions {
            text-align: right;
            white-space: nowrap;
        }
        .admin-source-action-group {
            display: inline-flex;
        }
        .admin-source-action-btn {
            padding: 2px 8px;
        }
        .admin-source-action-danger {
            background: transparent;
            color: var(--error);
            border-color: var(--error);
        }

        .admin-source-action-danger:hover {
            background: var(--error-bg);
        }
        .admin-source-row-empty td {
            color: var(--text-secondary);
        }
        .sort-list {
            list-style: none;
            padding: 0;
            margin: 0 0 16px;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .sort-list-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            background: var(--surface-2);
            color: var(--text-1);
            border: 1px solid var(--border);
            border-radius: 8px;
            cursor: grab;
            user-select: none;
            box-shadow: var(--shadow-sm);
        }
        .sort-list-item:hover {
            background: color-mix(in srgb, var(--surface-2) 68%, var(--surface) 32%);
        }
        .sort-list-item-handle {
            opacity: 0.45;
            font-size: 1.1rem;
            line-height: 1;
            color: var(--text-secondary);
        }
        .sort-list-item-title {
            flex: 1;
            min-width: 0;
            color: var(--text-1);
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        .spin-icon {
            display: inline-block;
            animation: spin 1s linear infinite;
        }

        /* Project songs modal */
        .project-song-row:hover {
            background: var(--surface-2);
        }
        .project-song-row:has(input:checked) {
            background: var(--accent-tint, rgba(99,102,241,0.08));
        }

        @media (min-width: 1100px) {
            .audio-source-selector {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }

        @media (max-width: 760px) {
            #song-content-modal {
                padding: 12px 0;
            }

            .song-content-modal-content {
                width: min(100vw - 20px, 1180px);
                max-height: calc(100vh - 24px);
                padding: 22px 18px;
            }

            .project-modal-content {
                width: min(100vw - 20px, 1180px);
                max-height: calc(100vh - 24px);
                padding: 22px 18px;
            }

            .song-content-modal-head {
                align-items: flex-start;
                flex-wrap: wrap;
            }

            .song-content-tab-bar .content-tab-btn {
                flex: 1 1 100%;
                justify-content: center;
            }
        }
