body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 2rem;
  background: #f9f9f9;
  color: #333;
}
h1 { color: #2c3e50; }
section { margin-bottom: 2rem; }
.toggle-doc {
  background: #2980b9;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
}
.toggle-doc:hover { background: #1f6391; }

.chat-spinner {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.85);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 10;
}

.chat-section {
  position: relative;
}

.chat-spinner .spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #2980b9;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}
.chat-spinner .spinner-text {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: #555;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.main-wrapper {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.form-section { flex: 1 1 350px; }
.description-section {
  flex: 1 1 300px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 1rem;
  box-sizing: border-box;
  max-height: 80vh;
  overflow-y: auto;
}
#docPanel { display: none; }
.desc {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.2rem;
}
label { display: block; margin-top: 0.8rem; }
input[type=text],
input[type=number],
select,
textarea {
  width: 100%;
  padding: 0.5rem;
  box-sizing: border-box;
  font-family: monospace;
}
.checkbox { display: flex; align-items: center; }
.checkbox input { width: auto; margin-right: 0.5rem; }
button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  background: #27ae60;
  color: #fff;
  border: none;
  cursor: pointer;
}
button:hover { background: #219150; }
.chat-section {
  background: #fff;
  border: 1px solid #ddd;
  padding: 1rem;
  box-sizing: border-box;
}
.chat-box {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 0.8rem;
}
.bubble {
  max-width: 70%;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  line-height: 1.4;
  word-wrap: break-word;
}
.user { background: #dcf8c6; align-self: flex-end; }
.assistant { background: #f1f0f0; align-self: flex-start; border: 1px solid #e0e0e0; }

.chat-input {
  display: flex;
  gap: 0.5rem;
}
.chat-input input {
  flex: 1;
  padding: 0.5rem;
  font-size: 1rem;
}
.chat-input button {
  background: #2980b9;
  color: #fff;
}
.chat-input button:hover { background: #1f6391; }
.result-section pre {
  background: #fff;
  border: 1px solid #ddd;
  padding: 1rem;
  overflow-x: auto;
}
