* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

.app-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.panel {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

h1,
h2 {
  margin-top: 0;
}

.subtitle {
  color: #94a3b8;
  margin-top: -8px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.field-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
  color: #cbd5e1;
}

input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #f8fafc;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #f8fafc;
  resize: vertical;
}

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

.actions.wrap {
  flex-wrap: wrap;
}

button {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

button.secondary {
  background: #475569;
}

button.danger {
  background: #dc2626;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-row {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.label {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

#voiceStatus[data-state="listening"] {
  color: #38bdf8;
}

#voiceStatus[data-state="processing"] {
  color: #fbbf24;
}

#voiceStatus[data-state="ready"] {
  color: #22c55e;
}

#voiceStatus[data-state="error"] {
  color: #f87171;
}

.voice-status-row {
  margin-top: 16px;
}

.voice-transcript {
  margin-top: 16px;
}

pre,
.log-view {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
}

.log-view {
  min-height: 220px;
  max-height: 320px;
  font-family: Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.log-entry {
  padding: 6px 0;
  border-bottom: 1px solid #1e293b;
}

.log-entry:last-child {
  border-bottom: 0;
}
