    :root {
        --sugar-grey: #808080;
        --sugar-dark: #282828;
        --sugar-med: #505050;
        --sugar-light: #c0c0c0;
        --sugar-accent: #282828;
    }

    body {
        margin: 0;
        overflow: hidden;
        background-color: var(--sugar-grey);
        font-family: sans-serif;
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh; 
    }
    
* {
    cursor: url("cursor.png") 0 0, default !important;
}

input,
textarea,
[contenteditable="true"] {
    cursor: url("textcursor.png") 0 0, default !important;
}

    #toolbar {
        background-color: var(--sugar-dark);
        height: auto;
        color: white;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        user-select: none;
        z-index: 10;
    }

    .controls-container {
        padding: 15px;
        background-color: var(--sugar-dark);
        width: 100%;
        box-sizing: border-box;
    }

    .control-panel {
        display: none;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
    }

    .control-panel.active {
        display: flex;
    }

    .tabs {
        display: flex;
        width: 100%;
        background-color: var(--sugar-med);
    }

    .tab {
        padding: 8px 25px;
        cursor: pointer;
        font-size: 14px;
        color: white;
        text-align: center;
        border-right: 1px solid var(--sugar-grey);
        background-color: var(--sugar-med);
    }

    .tab:last-child {
        border-right: none;
    }

    .tab.active {
        background-color: var(--sugar-accent);
        color: white;
    }

    select {
        padding: 8px 15px;
        border-radius: 15px;
        border: none;
        background: var(--sugar-grey);
        color: white;
        font-weight: normal;
        outline: none;
        cursor: pointer;
        font-size: 14px;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 20px;
        padding-right: 30px;
    }
    
    select option {
        background: white;
        color: black;
    }

    .slider-container {
        display:flex; 
        align-items:center; 
        gap: 10px;
        flex-grow: 1;
        min-width: 120px;
        max-width: 300px;
    }

    input[type=range] {
        -webkit-appearance: none;
        width: 100%;
        background: transparent;
    }

    input[type=range]:focus {
        outline: none;
    }

    input[type=range]::-webkit-slider-runnable-track {
        width: 100%;
        height: 10px;
        cursor: pointer;
        background: var(--sugar-grey);
        border-radius: 5px;
    }

    input[type=range]::-webkit-slider-thumb {
        height: 22px;
        width: 22px;
        border-radius: 50%;
        background: var(--sugar-grey);
        border: 4px solid white; 
        cursor: pointer;
        -webkit-appearance: none;
        margin-top: -6px;
    }

    input[type=range]::-moz-range-track {
        width: 100%;
        height: 10px;
        cursor: pointer;
        background: var(--sugar-grey);
        border-radius: 5px;
    }

    input[type=range]::-moz-range-thumb {
        height: 14px;
        width: 14px;
        border: 4px solid white;
        border-radius: 50%;
        background: var(--sugar-grey);
        cursor: pointer;
    }

    .sugar-btn {
        background-color: white;
        color: black;
        border: none;
        padding: 8px 20px;
        border-radius: 20px;
        font-weight: bold;
        cursor: pointer;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: background 0.2s;
    }
    .sugar-btn:hover { background-color: #f0f0f0; }
    .sugar-btn:disabled { opacity: 0.5; cursor: not-allowed; }
    
    #recording-indicator {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background-color: red;
        display: none;
        animation: blink 1s infinite;
    }
    
    @keyframes blink {
        0% { opacity: 1; }
        50% { opacity: 0.3; }
        100% { opacity: 1; }
    }

    #canvas-container {
        flex-grow: 1;
        position: relative;
        background-color: var(--sugar-grey);
        touch-action: none;
        width: 100%;
        overflow: hidden;
    }

    canvas {
        display: block;
        width: 100%;
        height: 100%;
    }

    #bottom-bar {
        height: auto;
        min-height: 70px;
        background-color: var(--sugar-light);
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0px;
        position: relative;
        z-index: 10;
    }

    .input-wrapper {
        width: 100%;
        height: 100%;
        position: relative;
        display: flex;
        align-items: stretch;
        background: white;
        border-radius: 30px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    #text-input {
        flex-grow: 1;
        height: 70px;
        border: none;
        padding: 0 20px;
        font-size: 32px;
        font-weight: bold;
        box-sizing: border-box;
        outline: none;
        background: white;
        font-family: sans-serif;
        color: black;
    }

    #history-btn {
        width: 60px;
        min-width: 60px; 
        flex-shrink: 0;  
        background-color: #a0a0a0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        user-select: none;
        border-left: 1px solid #ccc;
    }
    
    #history-btn svg {
        width: 30px;
        height: 30px;
        stroke: #404040;
        stroke-width: 2;
        fill: none;
    }

    #history-btn:hover { background-color: #b0b0b0; }

    #history-list {
        position: absolute;
        bottom: 60px;
        left: 0;
        right: 0;
        background: white;
        max-height: 40vh;
        overflow-y: auto;
        display: none;
        box-shadow: 0 -5px 15px rgba(0,0,0,0.2);
        z-index: 100;
        border-radius: 15px;
        margin-bottom: 10px;
    }

    .history-item {
        padding: 15px 20px;
        cursor: pointer;
        border-bottom: 1px solid #eee;
        color: black;
        font-size: 18px;
    }
    .history-item:hover { background-color: #f0f0f0; }

    @media (max-width: 600px) {
        .tab { padding: 8px 15px; font-size: 13px; }
        #text-input { font-size: 24px; height: 50px; }
        .control-panel { gap: 10px; justify-content: flex-start; }
        select { width: 48%; }
        .slider-container { width: 100%; max-width: none; }
    }
