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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.8rem;
    color: #1a1a2e;
}

.subtitle {
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* 3-panel grid */
.panels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.panel.active {
    border-color: #4a6fa5;
    box-shadow: 0 2px 12px rgba(74, 111, 165, 0.15);
}

.panel.loading textarea {
    opacity: 0.5;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: #f8f9fb;
    border-bottom: 1px solid #eee;
}

.lang-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
}

.panel-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.btn-icon:hover {
    background: #eee;
    color: #555;
}

.panel textarea {
    width: 100%;
    min-height: 180px;
    padding: 0.75rem;
    border: none;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
    outline: none;
    transition: opacity 0.2s;
}

.panel textarea::placeholder {
    color: #bbb;
}

/* Translate button */
.actions {
    margin-top: 1.25rem;
    text-align: center;
}

#translate-btn {
    padding: 0.7rem 3rem;
    background: #4a6fa5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#translate-btn:hover {
    background: #3a5a8a;
}

#translate-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Recording state */
.panel.recording {
    border-color: #e53e3e;
    box-shadow: 0 2px 12px rgba(229, 62, 62, 0.2);
}

.panel.recording .panel-header {
    background: #fff5f5;
}

.btn-mic {
    font-size: 1rem !important;
}

.panel.recording .btn-mic {
    color: #e53e3e;
}

.mic-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: #fff5f5;
    border-top: 1px solid #fee;
    font-size: 0.8rem;
    color: #e53e3e;
}

.mic-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e53e3e;
    animation: pulse 1s ease-in-out infinite;
}

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

/* Error */
.error {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    font-size: 0.9rem;
    text-align: center;
}

/* Responsive: stack vertically on small screens */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .panels {
        grid-template-columns: 1fr;
    }

    .panel textarea {
        min-height: 120px;
    }
}
