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"], input[type="number"] {
    width: 100%;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

/* Style the number input similarly to the select box */
input[type="number"] {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.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;
}

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;
}

button.record {
    background: #dc3545;
}

button.record:hover {
    background: #c82333;
}

/* Flashing animation while recording */
button.record.recording {
    background: #28a745;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}