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

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, #e8f8f0 0%, #f0f9ff 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.app { width: 100%; max-width: 820px; }

/* Header */
.header { display: flex; align-items: center; gap: 14px; margin-bottom: 1.8rem; }
.logo {
  width: 52px; height: 52px; background: #1D9E75;
  border-radius: 14px; display: flex; align-items: center;
  justify-content: center; font-size: 26px;
  box-shadow: 0 4px 12px rgba(29,158,117,0.3);
}
.header h1 { font-size: 24px; font-weight: 700; color: #1a1a1a; }
.header p { font-size: 13px; color: #1D9E75; font-weight: 500; }

/* Language Row */
.lang-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.lang-row select {
  flex: 1; padding: 11px 14px;
  border: 1.5px solid #c8e8d8; border-radius: 10px;
  font-size: 14px; background: #fff; color: #1a1a1a;
  cursor: pointer; font-weight: 500;
}
.lang-row select:focus { outline: none; border-color: #1D9E75; }

#swapBtn {
  width: 44px; height: 44px; border: 1.5px solid #c8e8d8;
  border-radius: 50%; background: #fff; font-size: 22px;
  cursor: pointer; color: #1D9E75; flex-shrink: 0; transition: all 0.2s;
}
#swapBtn:hover { background: #1D9E75; color: #fff; border-color: #1D9E75; }

/* Panels */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 580px) { .panels { grid-template-columns: 1fr; } }

.panel {
  background: #fff; border: 1.5px solid #d8eedf;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #f5fcf9;
  border-bottom: 1px solid #e0f0e8;
  font-size: 13px; font-weight: 600; color: #1D9E75;
}
.panel-header button {
  background: none; border: 1px solid #d0e8d8;
  font-size: 12px; color: #666; cursor: pointer;
  padding: 4px 10px; border-radius: 6px; transition: all 0.2s;
}
.panel-header button:hover { background: #e8f7f0; color: #1D9E75; border-color: #1D9E75; }

textarea {
  width: 100%; min-height: 160px; border: none;
  padding: 14px; font-size: 15px; font-family: inherit;
  resize: vertical; color: #1a1a1a; line-height: 1.7; background: #fff;
}
textarea:focus { outline: none; }

.panel-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; border-top: 1px solid #f0f0f0;
  background: #fafcfb;
}
.char-count { font-size: 12px; color: #aaa; }
.char-count.warning { color: #e07a30; }

.input-actions { display: flex; gap: 6px; }

.action-btn {
  padding: 6px 12px; border: 1.5px solid #c8e8d8;
  border-radius: 20px; background: #fff; font-size: 12px;
  color: #1D9E75; cursor: pointer; font-weight: 600;
  transition: all 0.2s;
}
.action-btn:hover { background: #1D9E75; color: #fff; border-color: #1D9E75; }
.action-btn.recording { background: #e05c3a; color: #fff; border-color: #e05c3a; animation: pulse 1s infinite; }

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

.output-box {
  min-height: 160px; padding: 14px;
  font-size: 15px; color: #1a1a1a; line-height: 1.7;
}
.placeholder { color: #ccc; font-style: italic; }

/* Image Preview */
#imagePreviewBox {
  background: #fff; border: 1.5px solid #d8eedf;
  border-radius: 14px; overflow: hidden;
  margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.preview-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #f5fcf9;
  border-bottom: 1px solid #e0f0e8;
  font-size: 13px; font-weight: 600; color: #1D9E75;
}
.preview-header button {
  background: none; border: 1px solid #f0c8c8;
  font-size: 12px; color: #e05c3a; cursor: pointer;
  padding: 4px 10px; border-radius: 6px;
}
#imagePreview {
  width: 100%; max-height: 200px; object-fit: contain;
  padding: 10px; background: #fafafa;
}
.preview-note {
  font-size: 12px; color: #e07a30; padding: 8px 14px;
  border-top: 1px solid #f5f0e8; background: #fffbf5;
}

/* Voice Status */
.voice-status {
  text-align: center; padding: 12px;
  background: #fff3f0; border: 1.5px solid #f0c8c0;
  border-radius: 10px; color: #e05c3a;
  font-weight: 600; font-size: 14px;
  margin-bottom: 14px; animation: pulse 1s infinite;
}

/* Translate Button */
.translate-btn {
  width: 100%; padding: 15px;
  background: #1D9E75; color: #fff; border: none;
  border-radius: 12px; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(29,158,117,0.3);
}
.translate-btn:hover { background: #178a63; transform: translateY(-1px); }
.translate-btn:disabled { background: #a0c8b8; cursor: not-allowed; transform: none; box-shadow: none; }

/* Status */
.status { text-align: center; font-size: 13px; color: #666; margin-top: 10px; min-height: 20px; }
.status.error { color: #e05c3a; }
.status.success { color: #1D9E75; font-weight: 500; }

/* Quick Phrases */
.quick-phrases { margin-top: 1.8rem; }
.quick-label { font-size: 13px; color: #888; margin-bottom: 10px; font-weight: 500; }
.phrases { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border: 1.5px solid #c8e6d8;
  border-radius: 20px; background: #fff; font-size: 13px;
  color: #1a6a45; cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.chip:hover { background: #1D9E75; color: #fff; border-color: #1D9E75; }

/* History */
.history-section { margin-top: 2rem; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.history-header button {
  font-size: 12px; padding: 4px 12px; border: 1px solid #ddd;
  border-radius: 6px; background: #fff; cursor: pointer; color: #888;
}
.history-header button:hover { background: #fff0f0; color: #e05c3a; border-color: #e05c3a; }
.history-item {
  background: #fff; border: 1px solid #e8f0ec;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; font-size: 13px;
}
.history-item .hi-langs { color: #1D9E75; font-weight: 600; font-size: 11px; margin-bottom: 6px; text-transform: uppercase; }
.history-item .hi-original { color: #555; margin-bottom: 4px; }
.history-item .hi-translated { color: #1a1a1a; font-weight: 500; }

/* Feature badges */
.feature-badges {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.badge {
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: #e8f7f0; color: #1D9E75; border: 1px solid #c8e8d8;
}