* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, #f0f4ff 0, #fdfdff 35%, #f7f7fb 70%);
  color: #1f2937;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 1rem;
}

.lead {
  margin: 0.25rem 0 0;
  color: #4b5563;
}

main {
  width: 100%;
  max-width: 480px;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(31, 41, 55, 0.15);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

button {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.9rem 1.1rem;
  transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.record {
  flex: 1;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.record:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.status {
  margin: 0;
  color: #374151;
  font-weight: 600;
}

.output {
  background: #f9fafb;
  border-radius: 12px;
  padding: 0.9rem;
  min-height: 80px;
}

.output h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #111827;
}

.response-text {
  margin: 0;
  color: #1f2937;
  word-break: break-word;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.confirm {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.30);
}

.confirm:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.22);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  visibility: hidden;
}

.spinner.active {
  visibility: visible;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

footer {
  margin-top: 1.5rem;
  color: #6b7280;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .controls {
    flex-direction: column;
  }

  .record {
    width: 100%;
  }
}
