body {
  font-family: 'Segoe UI', sans-serif;
  background: #f9f9f9;
  color: #333;
  margin: 0;
  padding: 0;
}
h1 {
  text-align: center;
  padding: 18px 0;
  background: #333;
  color: white;
  margin: 0 0 28px 0;
  font-size: 1.6em;
  font-weight: bold;
  letter-spacing: 1px;
}
h4 {
  text-align: center;
  margin-top: -15px;
  margin-bottom: 10px;
  color: #333;
  font-size: 0.8em;
  letter-spacing: 1px;
}
.expert-wrapper {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 10px 40px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.custom-prompt-block {
	width: 90%;
  background: #fff;
  border-radius: 10px;
  border: 1.5px solid #ccc;
  padding: 18px 22px 16px 22px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
}
#customPromptForm {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
}
#customPrompt {
  flex: 1;
  padding: 12px;
  border: 1.5px solid #ccc;
  border-radius: 5px;
  background: #fff;
  font-size: 1.1em;
  color: #27324a;
  width: 100%;
}
#customPromptForm button {
  padding: 12px 20px;
  background: #ccc;
  border: none;
  color: #333;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.08em;
  transition: background 0.2s;
}
#customPromptForm button:hover {
  background: orange;
}
#chat-box {
	width: 92%;
  min-height: 160px;
  margin-top: 10px;
  background: #fff;
  border: 1.5px solid #ccc;
  border-radius: 10px;
  padding: 18px 16px;
  font-size: 1.13em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === Editable Improved Prompt Option Styling === */
.response-option {
  background: #fff;
  /* border: 1px solid #ccc;*/
  padding: 14px 12px;
  margin: 15px 0;
  border-radius: 8px;
  width: 100%;
  text-align: left;
}
.option-headline {
  font-weight: bold;
  color: #333;
  margin-bottom: 6px;
  font-size: 1.08em;
  display: block;
}

/* New: Editable textarea for improved prompt options */
.improved-textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border-radius: 6px;
  border: 1.2px solid #bbb;
  margin: 10px 0 6px 0;
  padding: 10px;
  font-size: 1.0em;
  font-family: inherit;
  background: #f7f7fa;
  color: #222;
  box-sizing: border-box;
}

/* Controls below each editable option */
.option-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 2px;
}
.send-btn, .cancel-btn {
  padding: 7px 13px;
  font-size: 1em;
  border-radius: 5px;
  border: none;
  background: #ccc;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
}
.send-btn:hover {
  background: #70bf37;
  color: #fff;
}
.cancel-btn:hover {
  background: orange;
  color: #fff;
}

/* Buttons below all options */
#chat-box button {
  margin-right: 12px;
  margin-bottom: 6px;
}
#sendOriginal, #startOver{
  margin-top: 10px;
  padding: 8px 14px;
  font-size: 1em;
  border-radius: 5px;
  border: none;
  background: #ccc;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
}
#sendOriginal:hover, #startOver:hover {
  background: orange;
}

/* Enhanced AI Response Styling */

.ai-response {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  /*border: 1px solid #dee2e6;*/
  border-radius: 0px;
  padding: 20px;
  margin: 20px 0px;
  font-size: 1.1em;
  line-height: 1.6;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  width: 98%;
  text-align: left;
}

.ai-response .ai-label {
  color: #007bff;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 12px;
  display: block;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 8px;
}

/* --- AI response rich formatting below --- */
.ai-response p {
  margin-bottom: 14px;
  line-height: 1.7;
}
.ai-response ul, .ai-response ol {
  margin: 14px 0 14px 24px;
  padding-left: 22px;
}
.ai-response li {
  margin-bottom: 7px;
}
.ai-subheadline {
  display: block;
  margin: 14px 0 6px 0;
  font-weight: bold;
  color: #0a58ca;
  font-size: 1.08em;
  letter-spacing: 0.01em;
}
.ai-response strong {
  color: #333;
  font-weight: 600;
}
.ai-response code {
  background: #f5f2f0;
  color: #bf5500;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.98em;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}
/* Add some spacing for better readability */
.ai-response p:last-child {
  margin-bottom: 0;
}

/* Final prompt display */
.final-prompt {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  /* border-left removed for cleaner look */
  border-radius: 6px;
  padding: 15px;
  margin: 15px 0;
  font-size: 1em;
  width: 100%;
  text-align: left;
}
.final-prompt .prompt-label {
  color: #f39c12;
  font-weight: bold;
  margin-bottom: 8px;
  display: block;
}
.final-prompt .prompt-text {
  color: #856404;
  font-style: italic;
  margin: 0;
}

/* Thinking/loading state */
.thinking-state {
  background: #f8f9fa;
  border: 1px dashed #6c757d;
  border-radius: 6px;
  padding: 15px;
  text-align: center;
  color: #6c757d;
  font-style: italic;
  animation: pulse 1.5s ease-in-out infinite;
  width: 100%;
  margin: 15px 0;
}
@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Controls after final AI answer */
.ai-controls {
  text-align: right;
  margin-top: 18px;
  width: 100%;
}
.ai-controls button {
  padding: 8px 14px;
  font-size: 1em;
  border-radius: 5px;
  border: none;
  background: #ccc;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
}
.ai-controls button:hover {
  background: orange;
}

/* Responsive for mobile */
@media (max-width: 600px) {
  .expert-wrapper {
    padding: 0 3vw 20px 3vw;
  }
  .custom-prompt-block{
	  width: 92%;
  }
  .custom-prompt-block, #chat-box {
    padding: 14px 6vw;
    font-size: 1em;
  }
  #customPrompt{
	width: 92%;
  }
  
  #customPromptForm {
    flex-direction: column;
    gap: 7px;
  }
  #customPromptForm button {
    width: 100%;
  }
  .ai-response, .final-prompt, .thinking-state {
    padding: 12px;
    font-size: 1em;
  }
  .improved-textarea {
	min-height: 140px;
    font-size: 1em;
    padding: 8px;
  }
}
