* { box-sizing: border-box; }

:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #243047;
  background: #f4f7fb;
}

body { margin: 0; min-height: 100vh; }
button, textarea { font: inherit; }
button { cursor: pointer; }

.app {
  width: min(900px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.hero h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.2rem); }
.hero p { margin: 5px 0 0; font-size: 1.1rem; }
.mascot { font-size: 3.4rem; }

.card {
  background: white;
  border: 1px solid #dfe5ee;
  border-radius: 20px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 8px 30px rgba(30, 45, 70, 0.07);
}

.card h2 { margin-top: 0; }

textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  padding: 14px;
  border: 2px solid #ccd5e2;
  border-radius: 14px;
  outline: none;
}

textarea:focus { border-color: #65758b; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

button {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #243047;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
}

button:hover { filter: brightness(.97); }
button:disabled { cursor: not-allowed; opacity: .55; }
button.primary { background: #243047; color: white; border-color: #243047; }
button.recording { background: #fff1f1; border-color: #e09a9a; }

.status { min-height: 1.4em; margin-bottom: 0; }

#imagePreview {
  display: block;
  max-width: 100%;
  max-height: 430px;
  margin: 0 auto;
  border-radius: 14px;
  object-fit: contain;
}

.loading { display: flex; align-items: center; gap: 14px; }
.loading span { color: #65758b; }
.spinner {
  width: 28px;
  height: 28px;
  border: 4px solid #dfe5ee;
  border-top-color: #243047;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error { border-color: #efb4b4; background: #fffafa; }
.answer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { display: block; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #65758b; margin-bottom: 5px; }
.round-button { border-radius: 50%; width: 48px; height: 48px; padding: 0; font-size: 1.3rem; }
.speech { font-size: 1.12rem; line-height: 1.6; }
.transcript { padding: 12px 14px; background: #f4f7fb; border-radius: 12px; }
.transcript::before { content: "Erkannt: "; font-weight: 800; }

.code-section { margin-top: 18px; }
.code-title { font-weight: 800; margin-bottom: 7px; }
pre {
  margin: 0;
  overflow-x: auto;
  background: #172033;
  color: #f8fafc;
  padding: 16px;
  border-radius: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.hidden { display: none !important; }

@media (max-width: 600px) {
  .app { width: min(100% - 18px, 900px); padding-top: 18px; }
  .card { padding: 16px; border-radius: 16px; }
  .hero { align-items: flex-start; }
  .mascot { font-size: 2.7rem; }
  .actions button { flex: 1 1 150px; }
}
