*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6fb;
  color: #111827;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #fdfdfd, #eef2f7 60%, #e8edf5);
  color: inherit;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: min(960px, 100%);
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

header p {
  margin: 0;
  color: #4b5563;
  font-size: 1.05rem;
}

main {
  width: min(960px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: #ffffff;
  border-radius: 20px;
  padding: 1.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #1f2937;
}

input[type="url"],
input[type="text"] {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  background: #fff;
  color: #111827;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="url"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button {
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.75rem;
  margin-left: 0.75rem;
  background: #111827;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.15);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.row {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status {
  min-height: 1.5rem;
  font-size: 0.95rem;
  color: #4b5563;
}

.placeholder {
  color: #9ca3af;
  font-style: italic;
}

#endpoint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.endpoint {
  flex: 1 1 240px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: #f9fafb;
}

.endpoint button {
  margin: 0;
  width: 100%;
}

.endpoint .method {
  font-weight: 700;
  color: #111827;
}

.chat-log {
  min-height: 240px;
  max-height: 420px;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  padding: 1.25rem;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.chat-message {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  border: 1px solid #e5e7eb;
}

.chat-message.user {
  background: #eef2ff;
  border-color: #c7d2fe;
  align-self: flex-end;
}

.chat-message.assistant {
  background: #ffffff;
}

#chat-form {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

footer {
  width: min(960px, 100%);
  margin-top: 2rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  body {
    padding: 1.5rem 1rem 2.5rem;
  }

  .row,
  #chat-form {
    flex-direction: column;
  }

  button {
    width: 100%;
    margin-left: 0;
  }
}

