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

body {
  font-family: system-ui, sans-serif;
  background: #0f1117;
  color: #e8eaf0;
  min-height: 100vh;
  padding: 1.5rem;
}

#app { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.2rem; }

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
h1 { font-size: 1.3rem; font-weight: 700; color: #7cffcb; }
h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.6rem; color: #a8b4c8; }

.card {
  background: #1a1d2e;
  border: 1px solid #2a2f45;
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
}

.hint { font-size: 0.78rem; color: #6b7280; margin-bottom: 0.5rem; }

textarea {
  width: 100%;
  background: #0d0f1a;
  border: 1px solid #2a2f45;
  border-radius: 8px;
  color: #d1d5db;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 0.75rem;
  resize: vertical;
}
textarea:focus { outline: none; border-color: #5b7fff; }

/* Voice section */
.voice-card { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.voice-card h2 { align-self: flex-start; }

#status-box {
  background: #0d0f1a;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
  color: #9ca3af;
  min-height: 2.4rem;
}

.mic-btn {
  font-size: 1rem;
  padding: 0.75rem 2.5rem;
  border: none;
  border-radius: 999px;
  background: #3b4fd8;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-weight: 600;
}
.mic-btn:hover { background: #4f63f0; }
.mic-btn.active { background: #c0392b; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(192,57,43,.5)} 50%{box-shadow:0 0 0 10px rgba(192,57,43,0)} }

#recognized-box { width: 100%; min-height: 2rem; }
.interim-text { color: #6b7280; font-style: italic; font-size: 0.9rem; }
.final-text    { color: #60d394; font-weight: 600; font-size: 0.95rem; }

#response-text {
  line-height: 1.8;
  font-size: 0.95rem;
  color: #e8eaf0;
  white-space: pre-wrap;
}

.timing { font-size: 0.75rem; color: #6b7280; margin-top: 0.5rem; }

/* Badge */
.badge {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}
.badge-ok      { background: #064e3b; color: #34d399; }
.badge-error   { background: #450a0a; color: #f87171; }
.badge-pending { background: #1e293b; color: #94a3b8; }

/* Log */
.log-card { padding: 1rem 1.2rem; }
.log-card h2 { font-size: 0.85rem; }
#log {
  background: #0d0f1a;
  border-radius: 6px;
  padding: 0.6rem;
  font-size: 0.75rem;
  color: #6b7280;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: monospace;
}
