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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0a;
  color: #e5e5e5;
  height: 100vh;
  overflow: hidden;
}

#app {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.header {
  text-align: center;
  padding: 1rem 0;
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #fff;
}

.leaf {
  display: inline-block;
  animation: sway 3s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(10deg); }
}

.subtitle {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Chat area */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #555;
  font-size: 0.9rem;
}

.message {
  margin-bottom: 1rem;
  animation: fadeIn 0.3s ease;
}

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

.message-label {
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message-text {
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.75rem 1rem;
  border-radius: 12px;
}

.message.user .message-text {
  background: #1a1a2e;
  color: #a5b4fc;
  border-left: 3px solid #6366f1;
}

.message.assistant .message-text {
  background: #1a2e1a;
  color: #86efac;
  border-left: 3px solid #22c55e;
}

/* Controls */
.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0;
  gap: 0.75rem;
}

.mic-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid #333;
  background: #1a1a1a;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mic-btn:hover {
  border-color: #22c55e;
  color: #22c55e;
  background: #0d1f0d;
}

.mic-btn.active {
  border-color: #22c55e;
  color: #22c55e;
  background: #0d1f0d;
}

.mic-btn.listening {
  border-color: #22c55e;
  color: #22c55e;
  animation: pulse-green 2s ease-in-out infinite;
}

.mic-btn.thinking {
  border-color: #f59e0b;
  color: #f59e0b;
  animation: pulse-amber 1s ease-in-out infinite;
}

.mic-btn.speaking {
  border-color: #8b5cf6;
  color: #8b5cf6;
  animation: pulse-purple 1s ease-in-out infinite;
}

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

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
}

@keyframes pulse-amber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
}

@keyframes pulse-purple {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(139, 92, 246, 0); }
}

.mic-btn.paused {
  border-color: #666;
  color: #666;
  background: #1a1a1a;
  animation: none;
}

.system-text {
  text-align: center;
  font-size: 0.8rem;
  color: #666;
  background: transparent !important;
  border: none !important;
  padding: 0.25rem !important;
}

.mic-icon, .stop-icon {
  width: 28px;
  height: 28px;
}

.hidden {
  display: none;
}

.status {
  font-size: 0.8rem;
  color: #555;
  font-weight: 400;
}

.vu-meter {
  width: 120px;
  height: 4px;
  background: #222;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s;
}

.vu-meter.active {
  opacity: 1;
}

.vu-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #ef4444);
  border-radius: 2px;
  transition: width 0.1s;
}

/* Live transcript */
.chat-area-text {
  min-height: 1.5em;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  color: #86efac;
  font-style: italic;
  opacity: 0.7;
}

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

#textInput {
  flex: 1;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #e5e5e5;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#textInput:focus {
  border-color: #22c55e;
}

#textInput::placeholder {
  color: #444;
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  background: #141414;
  color: #666;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.send-btn:hover {
  border-color: #22c55e;
  color: #22c55e;
}

/* Login */
.login-container {
  justify-content: center;
  align-items: center;
}

.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
}

.login-label {
  font-size: 0.9rem;
  color: #888;
}

.pin-input {
  width: 160px;
  background: #141414;
  border: 2px solid #2a2a2a;
  border-radius: 12px;
  padding: 1rem;
  color: #fff;
  font-size: 1.8rem;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0.5em;
  outline: none;
  transition: border-color 0.2s;
}

.pin-input:focus {
  border-color: #22c55e;
}

.login-btn {
  width: 160px;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #22c55e;
  background: #0d1f0d;
  color: #22c55e;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.login-btn:hover {
  background: #22c55e;
  color: #000;
}

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

.login-error {
  font-size: 0.85rem;
  color: #ef4444;
  min-height: 1.2em;
}

.logout-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid #333;
  border-radius: 8px;
  color: #666;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.header {
  position: relative;
}

/* Mobile */
@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }
  .mic-btn {
    width: 64px;
    height: 64px;
  }
}
