        #drawingBoardDragHandle {
            background: var(--handle-bg);
            color: white;
            cursor: move;
            padding: 10px;
            text-align: center;
            font-weight: 500;
        }

#drawingControls {
    padding: 10px;
    background-color: var(--card-bg);
    display: flex;
    align-items: center;
    /* Change wrap to nowrap */
    flex-wrap: nowrap; 
    gap: 5px;
    /* Allow horizontal scrolling if the screen is too narrow */
    overflow-x: auto;
    /* Optional: Hide scrollbar on Chrome/Safari but keep functionality */
    -webkit-overflow-scrolling: touch;
}

/* Ensure buttons and inputs don't "squish" to try to fit */
#drawingControls button,
#drawingControls select,
#drawingControls input,
#drawingControls label,
#pageIndicator {
    flex-shrink: 0;
}

/* Optional: Clean up scrollbar look for Firefox/Chrome */
#drawingControls::-webkit-scrollbar {
    height: 4px;
}
#drawingControls::-webkit-scrollbar-thumb {
    background: var(--file-border);
    border-radius: 10px;
}

        #drawingControls label {
            margin-right: 1px;
        }

        #drawingControls button {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 30px;   /* icon-sized */
            height: 30px;
            margin: 2px;
            border: none;
            background: var(--file-bg);
            border-radius: 6px;
            cursor: pointer;
            transition: background 0.2s;
        }

        #drawingControls button:hover {
            background: var(--file-border);
        }

        /* Hide the text by default */
        #drawingControls .btn-text {
            display: none;
            position: absolute;
            top: 100%; 
            left: 50%;
            transform: translateX(-50%);
            font-size: 12px;
            background: rgba(0,0,0,0.75);
            color: white;
            padding: 2px 5px;
            border-radius: 3px;
            white-space: nowrap;
            pointer-events: none;
        }

        /* Show text on hover */
        #drawingControls button:hover .btn-text {
            display: block;
        }

	/* Add this to make dropdowns and range inputs match the button height */
#drawingControls select,
#drawingControls input[type="range"] {
    height: 28px;
    font-size: 12px;
}

        .icon-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 14px;
            padding: 5px;
        }
        
	.icon-btn.active {
            color: var(--secondary-color); /* highlight when active */
        }

        #drawingBoardWrapper button {
            background-color: var(--button-bg);
            color: white;
            border: none;
            padding: 8px 12px;
            margin: 5px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        #drawingBoardWrapper button:hover {
            background-color: var(--button-hover);
        }

        #canvasTextInput {
            position: absolute;
            border: 1px dotted #ccc;
            font: 16px Arial;
            color:#939393;
            padding: 0;
            z-index: 1000;
            background: white;
            outline: none;
            resize: none;
            field-sizing: content;
            min-height: 1rem;
            min-width:1rem;
        }

        #clearCanvas, #eraser, #addTextButton {
            background-color: var(--button-bg);
            border: none;
            padding: 8px 12px;
            border-radius: 6px;
            cursor: pointer;
            margin: 0 10px 10px 10px;
            transition: all 0.2s ease;
        }

        #clearCanvas:hover, #eraser:hover, #addTextButton:hover {
            background-color: var(--button-hover);
        }

        /*
        Equation and graph modals
        */

        .modalOverlay{
            position: absolute;
            align-items: center;
            justify-content: center;
            top:40px;
            left:0;
            width:100%;
            height:100%;
            background-color: rgba(0,0,0,0.5);
        }

        .modalOverlayContent{
            position: relative;
            flex-direction: column;
            display: flex;
            gap:20px;
            justify-content: center;
            padding:20px;
            color:var(--text-color);
            width:min(60%,600px);
            height:min(60%,400px);
            background-color: var(--board-bg);
            border-radius: 12px;
        }   

        #timelineOverlayContent, #tableOverlayContent{
            align-items: center;
            min-height:min(60%,200px);
        }

        .modalOverlayContent h3{
            font-weight:bold;
         }

        .modalOverlayClose{
            position: absolute;
            right:0;
            top:0;
            margin:10px;
            width:30px;
            border-radius:8px;
            border:none;
        }

        .modalInput{
            min-height:50px;
            border-radius: 12px;
            color:#2a3344;
            padding:5px;
            background-color:white;
            display: flex;
            align-items: center;
        }

        #graphInput, #equationInput{
            display: flex;
            align-items: center;
        }

        .modalButtonDiv{
            display: flex;
            align-items: center;
            justify-content: center;
            gap:3px;
            width:100%;
            flex-direction: column;
        }

        .modalButton{
            width:100%;
        }


        #equationSvgDiv{
            display: flex;
            font-size:200px;
            align-items: center;
            border-radius: 12px;
            padding:5px;
            background-color: white;
            color:#2a3344;
        }

        #equationSubmit, #graphSubmit{
            border-radius:12px;
            height:50px;
            border:none;
        }

        #equationSymbolInsert, #graphSymbolInsert{
            display: flex;
            gap:10px;
        }

        #equationSymbolInsert button, #graphSymbolInsert button{
            height:40px;
            width:40px;
            font-size:15px;
            padding:0;
            border-radius:12px;
            border:none;
        }

        .modalButtonDiv button{
            height:40px;
            width:100%;
            font-size:15px;
            padding:0;
            border-radius:12px;
            border:none;
        }

        #equationSymbolInsert #integral{
            font-size:10px;
        }

        #equationSymbolInsert #summation{
            font-size:8px;
        }


        #jsxGraph{
            width:300px;
            height:300px;
            background-color: white;
            border-radius: 12px;
        }

        #graphingFlexDiv{
            display: flex;
            gap:10px;
            padding-top:40px;
            padding-bottom:20px;
        }

        #graphingLeftDiv{
            display: flex;
            gap:10px;
            width:300px;
            flex-direction: column;
        }

        #graphInput{
            width:200px;
        }

        .modalInputDiv{
            display: flex;
            align-items: center;
            justify-content: center;
            gap:10px;
            width:100%
        }
        

        .modalInputDiv p{
            margin:0;
            text-align: center;
        }

        .modalInputDiv input{
            width:50%;
        }

        .modalInputDiv input:invalid{
            border: 1px solid red;
         }
        
        #graphInputDiv p{
            display: flex;
            width:min-content;
            font-weight: bold;
            font-size:20px;
            height:100%;
            margin: 0;
            align-items: center;
        }
