:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-surface: #f8fafc;
    --border-color: #e2e8f0;
    --border-highlight: #0284c7;
    
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --accent-red: #e11d48;
    --accent-red-hover: #be123c;
    --accent-blue: #0284c7;
    --accent-cyan: #0284c7;
    --accent-green: #059669;
    --accent-amber: #d97706;
    --chord-color: #be123c;
    
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-chord: 'JetBrains Mono', monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
}

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

html, body {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* App Header */
.app-header, .header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner, .header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.brand-logo, .logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
}

.brand-icon, .logo-icon {
    font-size: 1.25rem;
    color: var(--accent-red);
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #0f172a;
}

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

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}

.nav-btn i {
    font-size: 0.9rem;
}

.text-red { color: #e11d48; }
.text-blue { color: #0284c7; }
.text-green { color: #059669; }
.text-amber { color: #d97706; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}
.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.btn-google {
    background: #4285f4;
    color: #ffffff;
    border: none;
}
.btn-google:hover {
    background: #3367d6;
}

.btn-subtle {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}
.btn-subtle:hover {
    background: #e2e8f0;
}

.btn-save-vocal {
    background: var(--accent-green);
    color: #ffffff;
}
.btn-save-vocal:hover {
    background: #047857;
}

.btn-logout {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}
.btn-logout:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Main Container */
.app-main {
    max-width: 1050px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 16px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Search Card */
.search-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-leading-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 10px 40px 10px 40px;
    color: #0f172a;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
}
.clear-search-btn:hover {
    color: var(--text-main);
}

.btn-search {
    background: #0284c7;
    color: #ffffff;
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
}
.btn-search:hover {
    background: #0369a1;
}

.search-provider-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.provider-pill {
    background-color: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.provider-pill:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}
.provider-pill.active {
    background-color: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}
.provider-pill.active#pill-ultimate_guitar,
.provider-pill.active[data-provider="ultimate_guitar"] {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}
.provider-pill.active[data-provider="all"] {
    background-color: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.sheet-filter-pill {
    background-color: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.sheet-filter-pill:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}
.sheet-filter-pill.active {
    background-color: #059669;
    border-color: #059669;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.badge-sheet-tag {
    background: #0284c7;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Search Results Header & List */
.results-container {
    margin-top: 14px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.results-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 4px 10px 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.results-header-bar strong {
    color: var(--text-main);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-song-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.result-song-row:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.result-left-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    overflow: hidden;
}

.result-music-icon-wrap {
    width: 30px;
    height: 30px;
    background: #f1f5f9;
    color: #0284c7;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.result-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.badge-sheet-icon {
    color: var(--accent-green);
    font-size: 0.8rem;
}

.badge-key {
    background: #fee2e2;
    color: #be123c;
    border: 1px solid #fecdd3;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

.badge-rhythm {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

.result-composer {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.result-snippet {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.result-right-action {
    color: var(--text-muted);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-yt-watch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-yt-watch:hover {
    background: #dc2626;
}

/* Selected Song Sheet Viewer */
.song-sheet-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.song-header-area {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.song-main-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #be123c;
    margin-bottom: 6px;
    line-height: 1.2;
}

.song-meta-line {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.song-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.song-meta-item i {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Compact Toolbar */
.song-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.toolbar-button-group {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tool-btn {
    background: transparent;
    border: none;
    border-right: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s ease;
}

.tool-btn:last-child {
    border-right: none;
}

.tool-btn:hover {
    background: #f1f5f9;
}

.tool-btn-key-display {
    color: #be123c;
    font-weight: 800;
    font-family: var(--font-chord);
    padding: 6px 14px;
    background: #fee2e2;
}

.tool-btn.active {
    background: #be123c;
    color: #ffffff;
}

/* Lyrics & Chords Container */
.sheet-content-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 20px;
    min-height: 250px;
}

.sheet-lyrics-pre {
    font-family: var(--font-chord);
    font-size: 1rem;
    line-height: 1.45;
    color: #0f172a;
    white-space: pre-wrap;
    word-break: break-word;
}

.sheet-lyrics-pre .chord {
    color: #dc2626;
    font-weight: 700;
    display: inline;
}

/* Form Inputs */
.input-field {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    color: #0f172a;
    padding: 6px 10px;
    font-family: inherit;
    outline: none;
}
.input-field:focus {
    border-color: #0284c7;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    color: #0f172a;
}

.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}
.btn-close-modal:hover {
    color: #0f172a;
}

.modal-body {
    padding: 18px;
}

.user-info-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.profile-avatar-img {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid #0284c7;
}

.profile-name-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.profile-email-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.profile-role-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    background: #e0f2fe;
    color: #0284c7;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    margin-top: 3px;
}

.settings-group {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 16px;
}

.settings-title {
    font-size: 0.92rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: #0f172a;
}

.settings-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.vocal-selectors-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.vocal-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.vocal-select {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    color: #0284c7;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 7px;
    outline: none;
    cursor: pointer;
}

.vocal-select:focus {
    border-color: #0284c7;
}

.feedback-saved {
    color: var(--accent-green);
    font-size: 0.85rem;
    font-weight: 600;
}

.modal-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: #ffffff;
}

/* Singer Performances List (Matching HopAmViet Image 2) */
.singer-panel-card {
    margin-top: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.singer-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #0f172a;
}

.singer-list-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 280px;
    overflow-y: auto;
}

.singer-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.singer-item-row:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.singer-item-row.active {
    background: #f0fdf4;
    border-color: #86efac;
}

.singer-item-num {
    font-size: 0.82rem;
    color: #94a3b8;
    width: 20px;
    text-align: right;
    font-weight: 600;
}

.singer-play-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    cursor: pointer;
    flex-shrink: 0;
}

.singer-item-row:hover .singer-play-circle {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.singer-item-row.active .singer-play-circle {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
}

.singer-item-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
    flex: 1;
}

.singer-item-key {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
    font-family: var(--font-chord);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.singer-item-key:hover {
    background: #0284c7;
    color: #ffffff;
}

.singer-yt-direct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.singer-yt-direct-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    .header-inner, .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .search-form {
        flex-direction: column;
    }
    .btn-search {
        width: 100%;
    }
    .vocal-selectors-row {
        grid-template-columns: 1fr;
    }
}

/* YouTube Karaoke Panel Styles */
.karaoke-panel-card {
    margin-top: 20px;
    background: #ffffff;
    border: 1px solid #e9d5ff;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.06);
}

.karaoke-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3e8ff;
    font-size: 0.95rem;
    color: #581c87;
}

.karaoke-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.karaoke-search-input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid #d8b4fe;
    border-radius: 6px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s;
}

.karaoke-search-input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.karaoke-search-btn {
    padding: 7px 14px;
    background: #a855f7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}

.karaoke-search-btn:hover {
    background: #9333ea;
}

.karaoke-pills-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.karaoke-filter-pill {
    padding: 3px 10px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    color: #6b21a8;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.karaoke-filter-pill:hover,
.karaoke-filter-pill.active {
    background: #a855f7;
    border-color: #a855f7;
    color: #ffffff;
}

.karaoke-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
}

.karaoke-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #f3e8ff;
    background: #faf5ff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.karaoke-item-row:hover {
    background: #f3e8ff;
    border-color: #d8b4fe;
}

.karaoke-item-row.active {
    background: #ede9fe;
    border-color: #a855f7;
}

.karaoke-thumb {
    width: 64px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: #000;
}

.karaoke-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.karaoke-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.karaoke-item-meta {
    font-size: 0.76rem;
    color: #7e22ce;
    display: flex;
    align-items: center;
    gap: 8px;
}

.karaoke-item-key {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #d8b4fe;
    font-family: var(--font-chord);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.karaoke-item-key:hover {
    background: #7e22ce;
    color: #fff;
}

/* Homepage Lyrics Fullscreen Mode */
body.main-fullscreen-mode {
    overflow: hidden !important;
}

body.main-fullscreen-mode #selected-song-card {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px 28px 24px 28px !important;
    background: #ffffff !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: none !important;
    border: none !important;
}

body.main-fullscreen-mode .app-header,
body.main-fullscreen-mode .app-footer,
body.main-fullscreen-mode .search-card,
body.main-fullscreen-mode .song-header-area,
body.main-fullscreen-mode .song-toolbar-row,
body.main-fullscreen-mode #singer-tracks-panel-container,
body.main-fullscreen-mode #karaoke-panel-container {
    display: none !important;
}

/* Fullscreen Top Header on Homepage */
.main-fullscreen-header {
    display: none;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #e2e8f0;
}

body.main-fullscreen-mode .main-fullscreen-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.main-fullscreen-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px 0;
}

.main-fullscreen-meta {
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 600;
    margin: 0;
}

/* Floating Quick Action Pill Bar on Homepage */
.main-fs-floating-bar {
    display: none;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    padding: 4px 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: all 0.25s ease;
    opacity: 0.75;
    align-items: center;
    gap: 4px;
    user-select: none;
    flex-shrink: 0;
}

.main-fs-floating-bar:hover,
.main-fs-floating-bar:active,
.main-fs-floating-bar:focus-within {
    opacity: 1;
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(255, 255, 255, 0.45);
    transform: scale(1.02);
}

body.main-fullscreen-mode .main-fs-floating-bar {
    display: inline-flex !important;
}

.main-fs-pill-btn {
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.main-fs-pill-btn:hover,
.main-fs-pill-btn:active {
    background: rgba(255, 255, 255, 0.22);
    color: #38bdf8;
}

.main-fs-pill-btn.main-fs-pill-exit {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    margin-left: 2px;
}

.main-fs-pill-btn.main-fs-pill-exit:hover,
.main-fs-pill-btn.main-fs-pill-exit:active {
    background: #ef4444;
    color: #ffffff;
}

body.main-fullscreen-mode .sheet-content-container {
    flex: 1 !important;
    overflow-y: auto !important;
    margin-top: 0 !important;
    padding: 10px 14px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
}

body.main-fullscreen-mode .sheet-lyrics-pre {
    column-count: 2;
    column-gap: 40px;
    column-rule: 1px dashed #cbd5e1;
    line-height: 1.85;
    color: #0f172a;
    font-family: 'JetBrains Mono', monospace, sans-serif;
}

@media (max-width: 768px) {
    body.main-fullscreen-mode .sheet-lyrics-pre {
        column-count: 1;
    }
}

/* Smart Key Recommended Inline Badge */
.badge-smart-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid #10b981;
    color: #059669;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.1);
}
.badge-smart-key:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #059669;
}
.badge-smart-key:hover .btn {
    background: #047857 !important;
}

/* Responsive iPhone, iPad, Desktop Styles */
@media screen and (max-width: 767px) {
    .song-toolbar-row {
        gap: 6px !important;
        padding: 6px 8px !important;
        justify-content: flex-start !important;
    }
    .toolbar-button-group {
        flex-shrink: 0 !important;
    }
    .tool-btn {
        padding: 5px 8px !important;
        font-size: 0.8rem !important;
    }
    .song-main-title {
        font-size: 1.35rem !important;
    }
    .song-meta-line {
        gap: 8px !important;
        font-size: 0.8rem !important;
    }
    .sheet-content-container {
        padding: 12px 10px !important;
    }
    .sheet-lyrics-pre {
        font-size: 15px !important;
        line-height: 1.55 !important;
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .song-toolbar-row {
        gap: 8px !important;
        padding: 8px 12px !important;
    }
    .song-main-title {
        font-size: 1.6rem !important;
    }
}

/* Print Stylesheet for Homepage: Fits Cleanly in 1 A4 Page */
#main-print-header {
    display: none !important;
}

/* Chord Charts Panel on Homepage */
#main-chord-charts-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.chord-chart-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    user-select: none;
    transition: all 0.15s ease;
}

.chord-chart-card:hover {
    border-color: #0284c7;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

.chord-var-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 4px;
    cursor: pointer;
}
.chord-var-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

/* Fullscreen Edit Modal Styles for Homepage */
.modal-fullscreen-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 10000 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-fullscreen-dialog {
    background: #ffffff !important;
    color: #0f172a !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.modal-fullscreen-header {
    background: #ffffff !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
}

.modal-fullscreen-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 16px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    min-height: 0 !important;
    background: #ffffff !important;
}

.modal-fullscreen-footer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 12px 20px !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04) !important;
}

.modal-fullscreen-lyrics-textarea {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-height: 280px !important;
    padding: 14px 16px !important;
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    font-family: 'JetBrains Mono', Consolas, monospace !important;
    font-size: 15px !important;
    line-height: 1.75 !important;
    border-radius: 8px !important;
    resize: vertical !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
}
.modal-fullscreen-lyrics-textarea:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
    outline: none !important;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm 12mm 10mm 12mm;
    }
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .app-header,
    .app-footer,
    .search-section,
    .search-card,
    .song-header-area,
    .song-toolbar-row,
    .main-fullscreen-header,
    #singer-tracks-panel-container,
    #karaoke-panel-container,
    #main-chord-charts-panel,
    .modal-overlay,
    .modal-fullscreen-overlay,
    .nav-btn,
    .tool-btn,
    button {
        display: none !important;
    }
    #selected-song-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    #main-print-header {
        display: block !important;
        margin-bottom: 8px !important;
        padding-bottom: 4px !important;
        border-bottom: 1.5px solid #000000 !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    #main-print-title {
        font-size: 1.4rem !important;
        font-weight: 800 !important;
        color: #000000 !important;
        margin: 0 0 2px 0 !important;
    }
    #main-print-meta {
        font-size: 0.85rem !important;
        color: #1e293b !important;
        font-weight: 600 !important;
        margin: 0 !important;
    }
    .sheet-content-container {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .sheet-lyrics-pre {
        column-count: 2 !important;
        column-gap: 24px !important;
        column-rule: 1px solid #cbd5e1 !important;
        font-size: 10.5pt !important;
        line-height: 1.42 !important;
        color: #000000 !important;
        font-family: 'JetBrains Mono', Consolas, monospace !important;
        white-space: pre-wrap !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    .sheet-lyrics-pre .chord {
        color: #dc2626 !important;
        font-weight: 800 !important;
    }
}

