* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #e8f0ff, #f8fbff);
  color: #1f2937;
}

.container {
  width: min(980px, 94%);
  padding: 20px;
}

h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

p {
  color: #6b7280;
}

.card {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.92);
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

.row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
}

.row.two {
  margin-top: 18px;
}

.field {
  flex: 1;
}

.field.full {
  margin-top: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

select,
textarea,
input[type="range"],
button {
  width: 100%;
  border: none;
  outline: none;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
}

select,
textarea,
input[type="range"] {
  background: #f3f7ff;
}

textarea {
  min-height: 170px;
  resize: vertical;
}

.swap {
  font-size: 1.4rem;
  padding-bottom: 10px;
  color: #2563eb;
}

button {
  margin-top: 18px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

button.secondary {
  background: #e8efff;
  color: #1f3b8b;
}

.btnrow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.outputBox {
  margin-top: 22px;
  padding: 18px;
  background: #f8fbff;
  border-radius: 16px;
  border: 1px solid #e5eefc;
}

.outputHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

#outputText {
  margin-top: 8px;
  font-size: 1.05rem;
  color: #111827;
}

#detectedLang,
#status {
  margin-top: 8px;
  color: #2563eb;
  font-weight: 600;
}

#recordedAudio {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 760px) {
  .row {
    flex-direction: column;
  }

  .btnrow {
    grid-template-columns: 1fr;
  }

  .swap {
    display: none;
  }
}