* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #f4f5f7;
  color: #1b1f23;
}

.app-container {
  display: flex;
  max-width: 1100px;
  margin: 40px auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  gap: 24px;
}

.avatar-panel {
  width: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.avatar-frame {
  position: relative;
  width: 100%;
  padding-top: 180%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.avatar-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#avatar-speaking-indicator {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 12px;
  pointer-events: none;
}

.avatar-speaking {
  animation: glow 0.7s infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 4px rgba(0, 200, 255, 0.3);
  }
  to {
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.9);
  }
}

#mic-button {
  padding: 10px 20px;
  border-radius: 30px;
  border: none;
  background: #0078d4;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

#mic-button.listening {
  background: #d4004f;
}

.mic-status {
  font-size: 13px;
  color: #555;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-panel h1 {
  font-size: 22px;
  margin-bottom: 12px;
}

#chat-log {
  flex: 1;
  background: #f7f8fa;
  border-radius: 10px;
  padding: 12px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.message {
  margin-bottom: 10px;
  max-width: 90%;
}

.message.user {
  text-align: right;
}

.message.user span {
  background: #0078d4;
  color: #fff;
  border-radius: 16px 16px 0 16px;
  padding: 8px 12px;
  display: inline-block;
}

.message.bot span {
  background: #e6ebf2;
  border-radius: 16px 16px 16px 0;
  padding: 8px 12px;
  display: inline-block;
}

.manual-input {
  display: flex;
  gap: 8px;
}

.manual-input input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 20px;
  border: 1px solid #c3c7d0;
}

.manual-input button {
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: #0078d4;
  color: #fff;
  cursor: pointer;
}
