.playground-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  max-width: 1140px;
  height: calc(100vh - 80px);
  align-items: start;
}

.sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}

.sidebar h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--green);
}

.config-section {
  margin-bottom: 1.25rem;
}

.config-section label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.4rem;
}

.input-row {
  display: flex;
  gap: 0.4rem;
}

.input-row input {
  flex: 1;
  margin-bottom: 0;
}

#keyStatus {
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--white);
}

.status-dot {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #666;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected::before {
  background: var(--green);
}

.status-dot.disconnected::before {
  background: #ccc;
}

.tools-list {
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.85rem;
}

.tool-item {
  padding: 0.3rem 0.5rem;
  background: #f0f0f0;
  border-radius: 4px;
  margin-bottom: 0.3rem;
  font-family: monospace;
  font-size: 0.8rem;
}

.chat-area {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.message {
  margin-bottom: 1rem;
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

.message-content {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.message.user .message-content {
  background: var(--green);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background: #f0f0f0;
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.message-content ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.message-content li {
  margin-bottom: 0.25rem;
}

.message-content em {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #888;
}

.message-content code {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85rem;
}

.message-content pre {
  background: #1a1a1a;
  border-radius: 6px;
  padding: 0.75rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.message-content pre code {
  background: none;
  padding: 0;
  color: #e0e0e0;
  font-size: 0.8rem;
}

.message-content strong {
  font-weight: 700;
}

.streaming-cursor {
  animation: blink 1s step-end infinite;
  color: #666;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.chat-input-area {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.chat-input-area textarea {
  width: 100%;
  border: none;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  outline: none;
}

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.char-count {
  font-size: 0.8rem;
  color: #999;
}

@media (max-width: 768px) {
  .playground-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar {
    position: static;
  }

  .chat-area {
    height: 60vh;
  }

  .message-content {
    max-width: 90%;
  }
}
