* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1.5rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #0f1115;
  color: #e7eaf0;
  min-height: 100vh;
}

header { max-width: 720px; margin: 0 auto 1.5rem; }
header h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
header .sub { margin: 0; color: #8b93a3; font-size: 0.9rem; }

main {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: #1a1d24;
  border: 1px solid #262b35;
  border-radius: 8px;
  padding: 1rem;
}

.card h3 { margin: 0 0 0.5rem; font-size: 0.95rem; color: #b6bfd1; }

button {
  background: #7a3aff;
  color: white;
  border: 0;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
}

button:disabled {
  background: #3a3f4d;
  color: #6e7585;
  cursor: not-allowed;
}

button.danger { background: #c0392b; }

select {
  background: #0f1115;
  color: #e7eaf0;
  border: 1px solid #262b35;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
}

textarea {
  width: 100%;
  min-height: 5em;
  resize: vertical;
  background: #0f1115;
  color: #e7eaf0;
  border: 1px solid #262b35;
  border-radius: 6px;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

#connect-card { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

#robot-video {
  width: 100%;
  max-height: 240px;
  background: #000;
  border-radius: 6px;
  display: block;
  margin-bottom: 0.75rem;
}

.controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.muted { color: #8b93a3; font-size: 0.85rem; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #b6bfd1;
  user-select: none;
  cursor: pointer;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #3a3f4d;
  border-top-color: #7a3aff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner[hidden] { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

#speak-status.busy { color: #7a3aff; font-weight: 600; }

#model-loading { margin-top: 0.75rem; }

.bar {
  height: 6px;
  background: #262b35;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

#model-loading-bar {
  height: 100%;
  width: 0%;
  background: #7a3aff;
  transition: width 0.2s ease;
}

#log {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: #8b93a3;
  max-height: 10em;
  overflow-y: auto;
  white-space: pre-wrap;
}
