body {
    font-family: sans-serif;
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.speech-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 400px;
}

.settings label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 0.9rem;
}

select, input[type="range"] {
    width: 100%;
    margin-bottom: 1rem;
}

.buttons {
    display: flex;
    gap: 10px;
}

button {
    flex: 1;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover { background: #0056b3; }
button.secondary { background: #6c757d; }
button.secondary:hover { background: #545b62; }

.textarea-container {
    margin-bottom: 1rem;
}

/* Remove the old bottom margin from textarea since the container handles it */
textarea {
    width: 100%;
    height: 120px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 0; 
    transition: border-color 0.2s;
}

#char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
    font-weight: bold;
}

/* Error States */
#char-counter.exceeded {
    color: #d9534f; /* Red */
}

textarea.exceeded {
    border-color: #d9534f;
    outline-color: #d9534f;
    background-color: #fdf2f2;
}

/* Disable button visually */
button:disabled {
    background: #ccc;
    cursor: not-allowed;
}