* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f9fafb;
  color: #111827;
  min-height: 100vh;
  padding: 2rem 1rem;
  margin: 0;
}

.container {
  max-width: 48rem;
  margin: 0 auto;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  font-size: 2rem;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Status dot */
.status-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  transition: all 0.3s;
}

.status-ready { background: #22d3ee; }
.status-connecting { background: #9ca3af; }
.status-listening {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  animation: pulse 1.5s ease-in-out infinite;
}
.status-error { background: #ef4444; }
.status-disconnected { background: #9ca3af; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Cards */
.controls-card,
.pipeline-card,
.activity-card,
.console-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid #e5e7eb;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

/* Text input */
.text-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.text-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.text-input:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

.btn-send {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  background: #22d3ee;
  color: #0f172a;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-send:hover {
  background: #06b6d4;
}

/* Controls */
.button-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn {
  flex: 1;
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #111827;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #374151;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.btn-clear {
  background: none;
  border: none;
  font-size: 0.6875rem;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
}

.btn-clear:hover {
  color: #6b7280;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
}

.status-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
}

.session-hint {
  margin-top: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: #4b5563;
  text-align: center;
}

.session-hint.hidden {
  display: none;
}

/* Pipeline */
.pipeline-card {
  background: #1a1a20;
  color: #f3f4f6;
  border-color: transparent;
}

.turn-badge {
  font-family: ui-monospace, monospace;
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.turn-active {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.15);
}

.turn-waiting {
  color: #6b7280;
  background: #252530;
}

.pipeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pipeline-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.pipeline-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  min-width: 3rem;
}

.pipeline-value {
  font-size: 0.875rem;
  flex: 1;
  word-break: break-word;
  min-height: 1.25rem;
}

/* Activity */
.activity-list,
.log-list {
  max-height: 20rem;
  overflow-y: auto;
}

.activity-empty,
.log-empty {
  color: #9ca3af;
  font-size: 0.875rem;
  padding: 1.25rem 0;
  text-align: center;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  margin-bottom: 0.625rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.activity-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.activity-icon-stt { background: rgba(34, 211, 238, 0.1); }
.activity-icon-agent { background: rgba(168, 85, 247, 0.1); }
.activity-icon-tts { background: rgba(249, 115, 22, 0.1); }
.activity-icon-tool { background: rgba(59, 130, 246, 0.1); }

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.125rem;
}

.activity-label-stt { color: #22d3ee; }
.activity-label-agent { color: #a855f7; }
.activity-label-tts { color: #f97316; }
.activity-label-tool { color: #3b82f6; }

.activity-text {
  font-size: 0.875rem;
  color: #111827;
  line-height: 1.5;
  word-break: break-word;
}

.activity-time {
  font-family: ui-monospace, monospace;
  font-size: 0.625rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

/* Console */
.log-list {
  font-family: ui-monospace, monospace;
  font-size: 0.6875rem;
  color: #4b5563;
  line-height: 1.6;
}

.log-entry {
  padding: 0.125rem 0;
  border-bottom: 1px solid #f3f4f6;
}

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

.log-time {
  color: #9ca3af;
  margin-right: 0.5rem;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}
