/* Chord detail bottom toolbar. Scope all styles to avoid affecting sheet pages. */
#toolBar.mc-chord-toolbar {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

#toolBar.mc-chord-toolbar #subToolBar {
    float: none !important;
    width: 100% !important;
    box-sizing: border-box;
    border: 1px solid #e2e5e9 !important;
    border-top: 2px solid #de6c52 !important;
    border-radius: 8px 8px 0 0;
    background-color: #fff !important;
    box-shadow: 0 -3px 12px rgba(20, 30, 45, 0.07);
}

#toolBar.mc-chord-toolbar #subToolBar > table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0;
}

#toolBar.mc-chord-toolbar #subToolBar > table > tbody > tr > td:first-child {
    width: auto !important;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

#toolBar.mc-chord-toolbar #scrlDiv {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 7px;
    float: none !important;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
    padding: 6px 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#toolBar.mc-chord-toolbar #scrlDiv > .chord-comp {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    float: none !important;
    box-sizing: border-box;
    min-height: 34px;
    margin: 0 !important;
    padding: 1px 5px !important;
    border: 1px solid #e4e7eb;
    border-radius: 6px;
    background-color: #fff !important;
    color: #303846;
    font-size: 14px;
    white-space: nowrap;
}

#toolBar.mc-chord-toolbar #scrlDiv .chord-lb {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    color: #4b5563;
    font-size: 13px;
    font-weight: bold;
    line-height: 29px;
}

#toolBar.mc-chord-toolbar #scrlDiv input[type="button"] {
    box-sizing: border-box;
    width: 30px !important;
    min-width: 30px;
    height: 29px;
    margin: 0 2px;
    padding: 2px 4px !important;
    border: 1px solid #e2e5e9;
    border-radius: 5px !important;
    background-color: #f3f4f6 !important;
    color: #334155 !important;
    font-size: 15px;
    font-weight: bold;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
}

#toolBar.mc-chord-toolbar #scrlDiv input[type="button"]:hover:not(:disabled) {
    border-color: #d2a092;
    background-color: #fff5f1 !important;
}

#toolBar.mc-chord-toolbar #scrlDiv input[type="button"]:disabled {
    background-color: #f7f7f8 !important;
    color: #9ca3af !important;
    border-color: #eceef0;
    cursor: not-allowed;
}

#toolBar.mc-chord-toolbar #scrlDiv select {
    box-sizing: border-box;
    height: 29px;
    min-width: 45px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 2px 4px;
    border: 1px solid #e2e5e9;
    border-radius: 5px;
    background-color: #fff !important;
    color: #303846 !important;
    font-size: 14px;
    font-weight: bold;
    vertical-align: middle;
}

/* Keep metronome controls on the same baseline as the other toolbar groups.
   The legacy template sets height:15px and float:right on #beat-outer. */
#toolBar.mc-chord-toolbar #beat-outer {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    float: none !important;
    height: auto !important;
    min-height: 29px;
}

#toolBar.mc-chord-toolbar #beat-outer #beat-play {
    float: none !important;
}

#toolBar.mc-chord-toolbar #beat-outer #beatSlower {
    margin-left: 2px !important;
}

#toolBar.mc-chord-toolbar #beat-outer #beatTempo {
    margin: 0 4px !important;
}

#toolBar.mc-chord-toolbar #beat-outer #tempoSep {
    float: none !important;
    height: 24px !important;
    margin: 0 2px;
    align-self: center;
}

#toolBar.mc-chord-toolbar #ch-type {
    width: 88px;
}

#toolBar.mc-chord-toolbar #scrlDiv #ch-index,
#toolBar.mc-chord-toolbar #scrlDiv #ch-tone {
    color: #334155;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

#toolBar.mc-chord-toolbar #showedBar {
    width: 36px;
    min-width: 36px;
    box-sizing: border-box;
    padding: 0 7px !important;
    border-left: 1px solid #e4e7eb;
    background-color: #f8f9fa !important;
    color: #475467 !important;
    text-align: center;
    font-size: 17px;
    cursor: pointer;
}

#toolBar.mc-chord-toolbar #showedBar:hover {
    background-color: #eef0f3 !important;
}

#toolBar.mc-chord-toolbar #hiddenBar {
    box-sizing: border-box;
    min-width: 40px;
    height: 40px;
    padding: 0 11px !important;
    border: 1px solid #e2e5e9;
    border-left: 3px solid #de6c52;
    border-radius: 0 6px 0 0;
    background-color: #fff !important;
    box-shadow: 0 -2px 8px rgba(20, 30, 45, 0.07);
    color: #475467 !important;
    text-align: center;
    font-size: 17px;
}

#toolBar.mc-chord-toolbar #showedBar:focus,
#toolBar.mc-chord-toolbar #hiddenBar:focus,
#toolBar.mc-chord-toolbar #scrlDiv input[type="button"]:focus,
#toolBar.mc-chord-toolbar #scrlDiv select:focus {
    outline: 2px solid #de6c52;
    outline-offset: -2px;
}


/* Restore the original repeat icon without inheriting global button backgrounds. */
#toolBar.mc-chord-toolbar #scrlDiv #ch-scroll-repeat {
    width: 32px !important;
    min-width: 32px;
    background-color: #f3f4f6 !important;
    background-image: url("/images/repeat.png") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: 19px auto !important;
}

/* The repeat settings modal lives inside #scrlDiv; override toolbar button sizing. */
#toolBar.mc-chord-toolbar #scrlDiv #chord-scroll-rp #chord-repeat-ok {
    display: inline-block;
    width: auto !important;
    min-width: 88px;
    max-width: none;
    height: 36px !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600;
    line-height: 20px !important;
    white-space: nowrap;
    overflow: visible;
    text-indent: 0;
}

#toolBar.mc-chord-toolbar #chord-scroll-rp #chord-delay-time {
    box-sizing: border-box;
    width: 46px;
    height: 32px;
    padding: 4px 5px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    text-align: center;
}

@media (max-width: 600px) {
    #toolBar.mc-chord-toolbar #scrlDiv {
        gap: 5px;
        padding: 5px 6px;
    }

    #toolBar.mc-chord-toolbar #scrlDiv input[type="button"] {
        min-width: 32px;
        width: 32px !important;
        height: 32px;
    }

    #toolBar.mc-chord-toolbar #showedBar {
        width: 40px;
        min-width: 40px;
    }
}