body {
    font-family: Arial, sans-serif;
}

/* Message container */
#message-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1055;
}

/* Loading overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Scale display */
.scale-note {
    font-size: 1rem;
}

/* Chord display */
.chord-note {
    font-size: 1rem;
}

/* Staff rendering */
/* Staff rendering */
.staff {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.measure {
    width: calc(100% / 4 - 10px);
    position: relative;
    min-height: 80px;
    border: 1px solid #000;
    padding: 4px;
    display: flex;
    flex-direction: column-reverse; /* low string at the bottom */
    justify-content: space-between;
    align-items: flex-start;
}

.measure-number {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.7rem;
    color: #666;
}

.measure .string {
    flex: 1;
    width: 100%;
    border-bottom: 1px solid #000;
    height: 20px;
    position: relative;
}

.measure .string:first-child {
    /* bottom string after column-reverse */
    border-bottom: none;
}

.measure .note {
    position: absolute;
    margin-right: 0;
    padding: 2px 4px;
    background: #eef;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: 24px;
}

.measure .note.rest {
    background: #f8f8f8;
    color: #666;
}

/* Context menu */
.context-menu {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 3000;
    display: none;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    position: relative;
}

.context-menu li:hover {
    background: #f0f0f0;
}


.context-menu .submenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: #fff;
    border: 1px solid #ccc;
    min-width: 120px;
    z-index: 3001;
}

.context-menu .submenu.two-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.context-menu .submenu.two-column {
    position: relative;
    left: 0;
    top: 0;
    display: flex;
}
.context-menu .submenu.two-column ul {
    list-style: none;
    margin: 0;
    padding: 0 4px;
}

.context-menu li:hover > .submenu {
    display: block;
}
.context-menu li:hover > .submenu.two-col {
    display: grid;
}
.context-menu li:hover > .submenu.two-column {
    display: flex;
}

.context-menu .submenu li {
    padding: 8px 12px;
    white-space: nowrap;
}

.context-menu .hints {
    border-top: 1px solid #ccc;
    padding: 4px 8px;
    font-size: 0.75rem;
}

.duration-menu {
    position: absolute;
    z-index: 3002;
    margin-top: 2px;
}
.measure-actions {
    text-align: center;
    margin-bottom: 6px;
}
.measure-actions i {
    cursor: pointer;
    margin: 0 4px;
}
.staff-break {
    width: 100%;
    border: 0;
    border-top: 2px dashed #666;
    margin: 10px 0;
}

/* Track tabs */
.nav-tabs .nav-link.active {
    background-color: #eef;
    font-weight: bold;
}

/* Track volume slider */
.track-volume {
    accent-color: #444;
}
.track-volume::-webkit-slider-runnable-track {
    background: #444;
}
.track-volume::-moz-range-track {
    background: #444;
}

/* Circle of fifths */
#fifths-wheel {
    width: 240px;
    margin: 0 auto;
}

.fifths-note {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
}

.fifths-note.minor {
    font-size: 0.7rem;
    fill: #555;
}
