.tool-window {
    position: absolute;

    background: #f0f0f0;
    border: 1px solid #333;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 5500;
    display: none; /* Hidden by default */
    flex-direction: column;
    top: 100px;
    left: 100px;

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    box-sizing: border-box;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    overflow: hidden;
}


.tool-window-header {
    background: #333;
    color: white;
    padding: 5px 10px;
    cursor: move;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    flex: 0 0 auto;
    touch-action: none;
}

.tool-window-content {
    padding: 10px;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 10px;
    cursor: pointer;
    width: unset;
    height: unset;
    padding: 8px 16px;
    box-shadow: none;
}

.close-btn:hover {
    color: #ff5555;
}

/* Backdrop for modal dialogs */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5000; /* Below dialog */
    display: none; /* Start hidden */
}

.tool-window-button-bar
{
    /*
    display: flex;
    justify-content: flex-end;
    flex-direction: row;
    gap: 1em;
    */
    text-align: center;
    margin: 3em 0em 1em 0em;

}

.tool-window-button-bar button {
    width: unset;
    
}





  /* Download Dialog */


        /* Nested styles scoped to dialog */
        .tool-window-content {
            background-color: white;
            margin: 0px;
            padding: 20px;
            box-sizing: border-box;
            width: min(300px, calc(100vw - 18px));
            max-width: 100%;
            border-radius: 5px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .accm-download-dialog .download-dialog-header {
            margin-bottom: 15px;
            font-size: 18px;
        }

        .accm-download-dialog select {
            width: 100%;
            padding: 8px;
            margin-bottom: 15px;
        }

        .accm-download-dialog .download-dialog-btn {
            padding: 8px 16px;
            background-color:  #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .accm-download-dialog .download-dialog-btn:hover {
            background-color:  #007bff;
        }


        /** --- **/

@media (max-width: 480px), (max-height: 560px) {
    .tool-window-content {
        padding: 12px;
    }

    .tool-window-button-bar {
        margin: 1.25em 0 0.5em;
    }
}

@media (pointer: coarse) {
    .close-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
    }
}
