.mtsp-song-display .toolbar-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
    position: relative;
}

.mtsp-song-display .tool-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.mtsp-song-display .tool-group label {
    font-weight: bold;
    margin-right: 5px;
    color: #333;
    font-size: 12px;
}

.mtsp-song-display.dark-mode .tool-group label {
    color: #d1d5db;
}

.mtsp-song-display .mtsp-language-select,
.mtsp-song-display .mtsp-key-select,
.mtsp-song-display .mtsp-font-select,
.mtsp-song-display .mtsp-section-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(45deg, #001f5f, #003f9f);
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
    min-width: 80px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: 'DejaVu Sans', sans-serif; /* Explicitly scoped font */
}

.mtsp-song-display .mtsp-language-select:hover,
.mtsp-song-display .mtsp-key-select:hover,
.mtsp-song-display .mtsp-font-select:hover,
.mtsp-song-display .mtsp-section-select:hover,
.mtsp-song-display .mtsp-language-select:focus,
.mtsp-song-display .mtsp-key-select:focus,
.mtsp-song-display .mtsp-font-select:focus,
.mtsp-song-display .mtsp-section-select:focus,
.mtsp-song-display .mtsp-language-select:active,
.mtsp-song-display .mtsp-key-select:active,
.mtsp-song-display .mtsp-font-select:active,
.mtsp-song-display .mtsp-section-select:active {
    background: linear-gradient(45deg, #002a88, #004fc8);
    outline: none;
    box-shadow: none;
}

.mtsp-song-display .mtsp-language-select option,
.mtsp-song-display .mtsp-key-select option,
.mtsp-song-display .mtsp-font-select option,
.mtsp-song-display .mtsp-section-select option {
    color: #000;
    background: #fff;
}

.mtsp-song-display.dark-mode .mtsp-language-select option,
.mtsp-song-display.dark-mode .mtsp-key-select option,
.mtsp-song-display.dark-mode .mtsp-font-select option,
.mtsp-song-display.dark-mode .mtsp-section-select option {
    color: #fff;
    background: #374151;
}

.mtsp-song-display .mtsp-translation-select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid #003f9f;
    background: #fff;
    font-size: 12px;
    color: #003f9f;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    min-width: 100px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: 'DejaVu Sans', sans-serif; /* Explicitly scoped font */
}

.mtsp-song-display .mtsp-translation-select:hover,
.mtsp-song-display .mtsp-translation-select:focus,
.mtsp-song-display .mtsp-translation-select:active {
    background: #f0f4ff;
    border-color: #002a88;
    outline: none;
    box-shadow: none;
}

.mtsp-song-display.dark-mode .mtsp-translation-select {
    background: #374151;
    color: #4fc3f7;
    border-color: #4fc3f7;
}

.mtsp-song-display.dark-mode .mtsp-translation-select:hover,
.mtsp-song-display.dark-mode .mtsp-translation-select:focus,
.mtsp-song-display.dark-mode .mtsp-translation-select:active {
    background: #455a64;
    border-color: #4fc3f7;
}

.mtsp-song-display .mtsp-translation-select option {
    color: #000;
    background: #fff;
}

.mtsp-song-display.dark-mode .mtsp-translation-select option {
    color: #fff;
    background: #374151;
}

.mtsp-song-display .mtsp-translation-select,
.mtsp-song-display .mtsp-section-select {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mtsp-song-display .mtsp-translation-select:focus,
.mtsp-song-display .mtsp-section-select:focus {
    outline: none !important;
    box-shadow: none !important;
}

.mtsp-song-display .mtsp-translation-select::selection,
.mtsp-song-display .mtsp-section-select::selection,
.mtsp-song-display .mtsp-translation-select::-moz-selection,
.mtsp-song-display .mtsp-section-select::-moz-selection {
    background: transparent;
    color: inherit;
}

.mtsp-song-display .tool-btn {
    padding: 7px;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    line-height: 1;
    overflow: hidden;
}

.mtsp-song-display .tool-btn i {
    font-size: 16px;
    line-height: 1;
}

.mtsp-song-display .tool-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.mtsp-song-display .tool-btn:active {
    transform: scale(0.95);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mtsp-song-display .tool-btn.selected {
    filter: brightness(1.2);
}

.mtsp-song-display .transpose-btn {
    background: linear-gradient(45deg, #001f5f, #003f9f);
}

.mtsp-song-display .transpose-btn:hover,
.mtsp-song-display .transpose-btn.selected {
    background: linear-gradient(45deg, #002a88, #004fc8);
}

.mtsp-song-display .tab-btn {
    background: linear-gradient(45deg, #333, #555);
}

.mtsp-song-display .tab-btn:hover {
    background: linear-gradient(45deg, #444, #666);
}

.mtsp-song-display .tab-btn.selected {
    background: linear-gradient(45deg, #222, #444);
}

.mtsp-song-display.dark-mode .tab-btn {
    background: linear-gradient(45deg, #4b5563, #6b7280);
}

.mtsp-song-display.dark-mode .tab-btn:hover {
    background: linear-gradient(45deg, #6b7280, #9ca3af);
}

.mtsp-song-display.dark-mode .tab-btn.selected {
    background: linear-gradient(45deg, #374151, #4b5563);
}

.mtsp-song-display .toggle-columns-btn {
    background: linear-gradient(45deg, #006442, #009b5c);
}

.mtsp-song-display .toggle-columns-btn:hover,
.mtsp-song-display .toggle-columns-btn.selected {
    background: linear-gradient(45deg, #00834f, #00ba6a);
}

.mtsp-song-display .font-btn,
.mtsp-song-display .style-btn {
    background: linear-gradient(45deg, #a50021, #d90039);
}

.mtsp-song-display .font-btn:hover,
.mtsp-song-display .style-btn:hover {
    background: linear-gradient(45deg, #c8002e, #ff003c);
}

.mtsp-song-display .download-btn {
    background: linear-gradient(45deg, #c95f00, #ff7b00);
}

.mtsp-song-display .download-btn:hover {
    background: linear-gradient(45deg, #e47000, #ff9c33);
}

.mtsp-song-display .copy-btn {
    background: linear-gradient(45deg, #76008f, #9c00c9);
}

.mtsp-song-display .copy-btn:hover {
    background: linear-gradient(45deg, #8900a3, #bb00f0);
}

.mtsp-song-display .highlight-btn {
    background: linear-gradient(45deg, #fbc02d, #fdd835);
}

.mtsp-song-display .highlight-btn:hover,
.mtsp-song-display .highlight-btn.selected {
    background: linear-gradient(45deg, #ffb300, #ffca28);
}

.mtsp-song-display .dark-mode-btn {
    background: linear-gradient(45deg, #607d8b, #90a4ae);
}

.mtsp-song-display .dark-mode-btn:hover,
.mtsp-song-display .dark-mode-btn.selected {
    background: linear-gradient(45deg, #78909c, #b0bec5);
}

.mtsp-song-display .fullscreen-btn {
    background: linear-gradient(45deg, #4caf50, #66bb6a);
}

.mtsp-song-display .fullscreen-btn:hover,
.mtsp-song-display .fullscreen-btn.selected {
    background: linear-gradient(45deg, #66bb6a, #81c784);
}

.mtsp-song-display .print-btn {
    background: linear-gradient(45deg, #0288d1, #29b6f6);
}

.mtsp-song-display .print-btn:hover {
    background: linear-gradient(45deg, #039be5, #4fc3f7);
}

.mtsp-song-display .tool-group.mtsp-section-group {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.mtsp-song-display .pdf-loading-spinner {
    width: 24px;
    height: 24px;
    border: 4px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 794px) {
    .mtsp-song-display .toolbar-buttons {
        gap: 8px;
        justify-content: space-between;
        overflow-x: auto;
    }
    .mtsp-song-display .tool-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
        padding: 6px;
    }
    .mtsp-song-display .mtsp-language-select,
    .mtsp-song-display .mtsp-key-select,
    .mtsp-song-display .mtsp-font-select,
    .mtsp-song-display .mtsp-section-select {
        min-width: 90px;
        font-size: 12px;
        padding: 6px 10px;
    }
    .mtsp-song-display #btn-two-col {
        display: inline-flex;
    }
}

@media (max-width: 480px) {
    .mtsp-song-display .toolbar-buttons {
        justify-content: flex-start;
    }
    .mtsp-song-display .tool-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 5px;
    }
}