* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 18px 16px 28px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 760px;
    width: 100%;
    margin: 18px auto 0;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.translation-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.translation-controls label {
    font-weight: 600;
    color: #333;
}

.translation-controls select {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
}

.translation-controls select:focus-visible {
    outline: 3px solid #111;
    outline-offset: 3px;
    border-color: #667eea;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:focus-visible {
    outline: 3px solid #111;
    outline-offset: 3px;
}

.btn-mic {
    background: #4CAF50;
    color: white;
}

.btn-mic:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-mic.recording {
    background: #f44336;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7); }
    50% { box-shadow: 0 0 0 15px rgba(244, 67, 54, 0); }
}

.btn-stop {
    background: #ff9800;
    color: white;
}

.btn-stop:hover {
    background: #f57c00;
    transform: scale(1.05);
}

.btn-copy {
    background: #2196F3;
    color: white;
}

.btn-copy:hover {
    background: #1976D2;
    transform: scale(1.05);
}

.btn-clear {
    background: #9e9e9e;
    color: white;
}

.btn-clear:hover {
    background: #757575;
    transform: scale(1.05);
}

.result-area {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.result-area:focus {
    outline: none;
    border-color: #667eea;
}

.result-area:focus-visible {
    outline: 3px solid #111;
    outline-offset: 3px;
}

.status {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.status.listening {
    background: #e8f5e9;
    color: #2e7d32;
}

.status.idle {
    background: #f5f5f5;
    color: #666;
}

.status.success {
    background: #e3f2fd;
    color: #1565c0;
}

.status.error {
    background: #ffebee;
    color: #b71c1c;
}

.copy-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.copy-message.show {
    opacity: 1;
}

.icon {
    font-size: 20px;
}

@media (max-width: 700px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 18px 14px;
        border-radius: 14px;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .controls {
        gap: 10px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 13px 16px;
        border-radius: 14px;
    }

    .translation-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .translation-controls select {
        width: 100%;
    }

    .result-area {
        min-height: 170px;
        padding: 14px;
    }

    .copy-message {
        width: calc(100% - 24px);
        text-align: center;
        border-radius: 12px;
        padding: 12px;
    }
}
