/* Practice stage: lời tự fit viewport (đọc cột như sheet) */
    .song-page-full {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0.35rem var(--hah-shell-pad, 28px) 1.5rem;
    }
    .song-page-header.hah-title-band {
        margin-bottom: 0.55rem;
    }
    .song-page-header .entry-title {
        margin: 0;
        font-size: clamp(1.4rem, 2.3vw, 1.95rem);
        line-height: 1.22;
        color: var(--hah-ink, #1a1c1e);
    }
    .song-meta-strip {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.3rem 0.85rem;
        margin-top: 0.35rem;
        font-size: 0.875rem;
        color: var(--hah-ink-muted, #5c636a);
    }
    .song-meta-strip .meta-item { margin: 0; }
    .song-meta-strip strong { color: var(--hah-ink, #1a1c1e); font-weight: 600; }
    .song-meta-actions {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 0.45rem;
    }
    .song-meta-actions .form-select {
        min-width: 10rem;
        max-width: 18rem;
    }
    .hah-song-body {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        align-items: start;
    }
    .hah-song-main { min-width: 0; }
    .hah-song-rail { display: none; min-width: 0; }
    .hah-song-rail-sticky { position: sticky; top: 100px; }
    @media (min-width: 768px) {
        .hah-song-body {
            grid-template-columns: minmax(120px, 140px) minmax(0, 1fr) minmax(120px, 140px);
            gap: 16px;
        }
        .hah-song-rail { display: block; }
    }
    @media (min-width: 1200px) {
        .hah-song-body {
            grid-template-columns: minmax(160px, 180px) minmax(0, 1fr) minmax(160px, 180px);
            gap: 20px;
        }
    }
    @media (min-width: 992px) {
        .hah-song-top-mobile { display: none; }
    }

    .lyric_toolbar {
        position: sticky;
        top: var(--hah-header-offset, 64px);
        z-index: 20;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem 0.75rem;
        margin-bottom: 0.65rem;
        padding: 0.55rem 0.75rem;
        background: var(--hah-surface, #fff);
        border: 1px solid var(--hah-border, #e3e6ea);
        border-radius: var(--hah-radius, 10px);
        box-shadow: 0 1px 2px rgba(26, 28, 30, 0.04);
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }
    .lyric_toolbar .transpose-cluster {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 0.5rem;
        min-width: 0;
    }
    .lyric_toolbar .transpose-label {
        margin: 0;
        font-size: 0.78rem;
        font-weight: 650;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--hah-ink-muted, #5c636a);
        white-space: nowrap;
    }
    .lyric_toolbar .transpose-control {
        display: inline-flex;
        align-items: stretch;
        height: 38px;
        border: 1px solid var(--hah-border-strong, #cfd4da);
        border-radius: 999px;
        background: var(--hah-surface-muted, #eef1f4);
        overflow: hidden;
    }
    .lyric_toolbar .transpose_control {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        min-width: 38px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--hah-ink, #1a1c1e);
        font-size: 0.95rem;
        line-height: 1;
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
    }
    .lyric_toolbar .transpose_control:hover {
        background: rgba(var(--hah-brand-rgb, 216, 48, 48), 0.08);
        color: var(--hah-brand, #d83030);
    }
    .lyric_toolbar .transpose_control:active {
        transform: scale(0.96);
        background: rgba(var(--hah-brand-rgb, 216, 48, 48), 0.14);
    }
    .lyric_toolbar .transpose_control:focus-visible {
        outline: 2px solid rgba(var(--hah-brand-rgb, 216, 48, 48), 0.35);
        outline-offset: -2px;
        z-index: 1;
    }
    .lyric_toolbar .chord_transpose {
        display: flex;
        align-items: stretch;
        border-left: 1px solid var(--hah-border, #e3e6ea);
        border-right: 1px solid var(--hah-border, #e3e6ea);
    }
    .lyric_toolbar .chord_transpose .dropdown-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        min-width: 4.25rem;
        height: 100%;
        margin: 0;
        padding: 0 0.85rem;
        border: 0;
        border-radius: 0;
        background: var(--hah-surface, #fff);
        color: var(--hah-ink, #1a1c1e);
        font-size: 1rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        box-shadow: none;
    }
    .lyric_toolbar .chord_transpose .dropdown-toggle::after {
        margin-left: 0.15rem;
        opacity: 0.55;
    }
    .lyric_toolbar .chord_transpose .dropdown-toggle:hover,
    .lyric_toolbar .chord_transpose .dropdown-toggle:focus,
    .lyric_toolbar .chord_transpose .dropdown-toggle.show {
        background: #fff;
        color: var(--hah-brand, #d83030);
        box-shadow: none;
    }
    .lyric_toolbar .chord_transpose .dropdown-menu {
        min-width: 4.5rem;
        max-height: 280px;
        overflow-y: auto;
        padding: 0.35rem;
        border: 1px solid var(--hah-border, #e3e6ea);
        border-radius: var(--hah-radius-sm, 6px);
        box-shadow: 0 10px 28px rgba(26, 28, 30, 0.12);
    }
    .lyric_toolbar .chord_transpose .dropdown-item {
        border-radius: 4px;
        padding: 0.4rem 0.65rem;
        font-weight: 600;
        text-align: center;
    }
    .lyric_toolbar .chord_transpose .dropdown-item:hover,
    .lyric_toolbar .chord_transpose .dropdown-item:focus {
        background: rgba(var(--hah-brand-rgb, 216, 48, 48), 0.08);
        color: var(--hah-brand, #d83030);
    }
    .lyric_toolbar .toolbar-actions {
        display: flex;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.4rem;
        margin-left: auto;
    }
    .lyric_toolbar .toolbar-actions .btn-tool {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        height: 38px;
        padding: 0 0.9rem;
        border: 1px solid var(--hah-border, #e3e6ea);
        border-radius: 999px;
        background: var(--hah-surface, #fff);
        color: var(--hah-ink, #1a1c1e);
        font-size: 0.875rem;
        font-weight: 600;
        line-height: 1;
        transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
    }
    .lyric_toolbar .toolbar-actions .btn-tool i {
        font-size: 0.85rem;
        opacity: 0.85;
    }
    .lyric_toolbar .toolbar-actions .btn-tool:hover {
        border-color: rgba(var(--hah-brand-rgb, 216, 48, 48), 0.35);
        color: var(--hah-brand, #d83030);
        background: #fff;
    }
    .lyric_toolbar .toolbar-actions .btn-tool:active {
        transform: scale(0.98);
    }
    .lyric_toolbar .toolbar-actions .btn-tool-primary {
        border-color: var(--hah-brand, #d83030);
        background: var(--hah-brand, #d83030);
        color: #fff;
    }
    .lyric_toolbar .toolbar-actions .btn-tool-primary:hover,
    .lyric_toolbar .toolbar-actions .btn-tool-primary:focus {
        border-color: var(--hah-brand-hover, #b82525);
        background: var(--hah-brand-hover, #b82525);
        color: #fff;
    }
    .lyric_toolbar .toolbar-actions .btn-tool-primary i { opacity: 1; }
    /* Never wrap to 2 rows — TÔNG + text labels drop before the bar grows. */
    @media (max-width: 991.98px) {
        .lyric_toolbar .transpose-label { display: none; }
    }
    @media (max-width: 767.98px) {
        .lyric_toolbar { padding: 0.45rem 0.5rem; gap: 0.4rem; }
        .lyric_toolbar .toolbar-actions .btn-tool span { display: none; }
        .lyric_toolbar .toolbar-actions .btn-tool { width: 38px; min-width: 38px; padding: 0; justify-content: center; }
        .lyric_toolbar .chord_transpose .dropdown-toggle { min-width: 3.25rem; padding: 0 0.55rem; }
    }

    .song-practice-stage {
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    /* Lời: chia đều số hàng; 90vh chỉ là trần phân trang */
    #lyrics-display-wrapper {
        width: 100%;
        box-sizing: border-box;
        background: var(--hah-surface, #fff);
        border: 1px solid var(--hah-border, #e3e6ea);
        border-radius: var(--hah-radius, 10px);
        padding: 0.85rem 1.1rem;
        font-family: 'Verdana', 'Segoe UI', sans-serif;
        font-size: 15px;
        line-height: 1.65;
        overflow: visible;
    }
    #lyrics-display-wrapper .lyric_line {
        margin: 0 0 0.15em;
    }
    #lyrics-display-wrapper.is-fitting {
        min-height: 280px;
    }
    #lyrics-display-wrapper.is-multicolumn {
        height: auto;
        max-height: none;
        overflow-x: visible;
        overflow-y: visible;
    }
    .lyrics-page-jump {
        position: sticky;
        top: calc(var(--hah-header-offset, 64px) + 52px);
        z-index: 15;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem;
        margin: 0 0 0.65rem;
        padding: 0.4rem 0.55rem;
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid var(--hah-border, #e3e6ea);
        border-radius: var(--hah-radius-sm, 6px);
        box-shadow: 0 1px 2px rgba(26, 28, 30, 0.04);
    }
    .lyrics-page-jump-label {
        margin-right: 0.25rem;
        font-size: 0.78rem;
        font-weight: 650;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--hah-ink-muted, #5c636a);
    }
    .lyrics-page-jump-btn {
        min-width: 2rem;
        height: 2rem;
        padding: 0 0.55rem;
        border: 1px solid var(--hah-border, #e3e6ea);
        border-radius: 999px;
        background: var(--hah-surface, #fff);
        color: var(--hah-ink, #1a1c1e);
        font-size: 0.875rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        cursor: pointer;
        transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }
    .lyrics-page-jump-btn:hover {
        border-color: rgba(var(--hah-brand-rgb, 216, 48, 48), 0.4);
        color: var(--hah-brand, #d83030);
    }
    .lyrics-page-jump-btn.is-active {
        border-color: var(--hah-brand, #d83030);
        background: var(--hah-brand, #d83030);
        color: #fff;
    }
    .lyrics-page {
        margin-bottom: 0.85rem;
        scroll-margin-top: calc(var(--hah-header-offset, 64px) + 110px);
    }
    .lyrics-page:last-child { margin-bottom: 0; }
    .lyrics-page-bar {
        display: block;
        width: 100%;
        margin: 0 0 0.55rem;
        padding: 0.4rem 0.75rem;
        border: 0;
        border-radius: var(--hah-radius-sm, 6px);
        background: var(--hah-surface-muted, #eef1f4);
        color: var(--hah-ink-muted, #5c636a);
        font-size: 0.82rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-align: left;
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease;
    }
    .lyrics-page-bar:hover {
        background: rgba(var(--hah-brand-rgb, 216, 48, 48), 0.08);
        color: var(--hah-brand, #d83030);
    }
    .lyrics-page-cols {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        width: 100%;
        gap: 1.1rem 1.75rem;
    }
    .lyrics-col {
        /* Width set by JS after stretch-to-fill calc (--hah-lyric-col-w).
           Height follows content (equal-row pack). 90vh is a MAX for pagination, not a min. */
        flex: 0 0 var(--hah-lyric-col-w, 280px);
        width: var(--hah-lyric-col-w, 280px);
        max-width: 100%;
        height: auto;
        max-height: var(--hah-lyric-col-h, 90vh);
        box-sizing: border-box;
        padding-right: 0.35rem;
        border-right: 1px dashed var(--hah-border, #e3e6ea);
        overflow: hidden;
    }
    .lyrics-page-cols .lyrics-col:last-child {
        border-right: none;
    }
    @media (max-width: 767.98px) {
        #lyrics-display-wrapper {
            height: auto !important;
            max-height: none !important;
            overflow: visible;
        }
        .lyrics-page-jump { display: none; }
        .lyrics-page-cols { display: block; }
        .lyrics-col {
            width: 100% !important;
            flex-basis: 100% !important;
            height: auto !important;
            border-right: none;
            padding-right: 0;
            overflow: visible;
        }
    }

    /* Thế tay: full-width dưới lời (giống sheet tập) */
    #song_chords_diagram.song-chords-panel {
        margin-top: 1rem;
        padding: 0.9rem 1rem 1rem;
        background: var(--hah-surface, #fff);
        border: 1px solid var(--hah-border, #e3e6ea);
        border-radius: var(--hah-radius, 10px);
    }
    #song_chords_diagram .song_chord_item,
    #song_chords_diagram .jtab,
    #song_chords_diagram .rendered,
    #song_chords_diagram svg {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
        vertical-align: top;
    }
    .song-practice-stage #song_chords_diagram .chords-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
        gap: 0.65rem 0.5rem;
        justify-items: center;
    }
    .song-practice-stage #song_chords_diagram .jtab,
    .song-practice-stage #song_chords_diagram .rendered {
        zoom: 0.88;
    }
    @supports not (zoom: 1) {
        .song-practice-stage #song_chords_diagram .jtab,
        .song-practice-stage #song_chords_diagram .rendered {
            transform: scale(0.88);
            transform-origin: top center;
            margin-bottom: -12%;
        }
    }
    .chords-container.collapsed {
        max-height: 280px;
        overflow: hidden;
        position: relative;
        -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
        mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    }
    .chords-container.expanded {
        max-height: none;
        -webkit-mask-image: none;
        mask-image: none;
    }
    #toggle-chords-view { display: block; margin: 10px auto 0; font-weight: bold; cursor: pointer; }

    .song-below {
        margin-top: 1.25rem;
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    @media (min-width: 992px) {
        .song-below {
            grid-template-columns: 1fr 1fr;
        }
    }
    .song-below .info-box {
        background: var(--hah-surface-muted, #f8f9fa);
        padding: 1rem 1.1rem;
        border-radius: var(--hah-radius-sm, 6px);
        margin: 0;
    }
    .song-below .info-box h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        border-bottom: 2px solid var(--hah-brand);
        padding-bottom: 0.45rem;
    }
    .song-below .info-box .meta-item { margin-bottom: 0.5rem; display: block; }
    .song-page-full .entry-content {
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    #catuLyricsModal .modal-dialog { max-width: 1200px; }
    #catuLyricsModal .catu-service-container { border: none; box-shadow: none; background: transparent; padding: 0; margin: 0; }
    #catuLyricsModal .catu-comparison { grid-template-columns: 1fr 40px 1fr; gap: 15px; }
    #catuLyricsModal .catu-comparison-arrow { font-size: 20px; }
    #catuLyricsModal .catu-original-lyrics { min-height: 200px; }
    #catuLyricsModal .catu-result { margin-top: 15px; }
    @media (max-width: 768px) {
        #catuLyricsModal .modal-dialog { margin: 10px; max-width: none; }
        #catuLyricsModal .catu-comparison { grid-template-columns: 1fr; }
        #catuLyricsModal .catu-comparison-arrow { transform: rotate(90deg); font-size: 16px; margin: 5px 0; }
    }
    #catu-in-player-btn {
        backdrop-filter: blur(5px);
        background: rgba(40, 167, 69, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
    }
    #catu-in-player-btn:hover {
        background: rgba(40, 167, 69, 1);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
