/* General Body and Layout */
body {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Use vh for modern browsers, fallback in body class */
    height: 100dvh; /* Dynamic viewport height */
    background-color: #f9fafb; /* bg-gray-50 */
    color: #111827; /* text-gray-900 */
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    margin: 0;
}

/* Header */
#main-header {
    background-color: white;
    border-bottom: 1px solid #e5e7eb; /* border-gray-200 */
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    height: 4rem; /* h-16 */
    flex-shrink: 0;
}
#main-header .flex { display: flex; align-items: center; gap: 0.5rem; }
#persona-icon { font-size: 1.5rem; }
#persona-name { font-weight: 700; color: #1f2937; line-height: 1.25; }

/* Chat Area */
#chat-area {
    flex: 1 1 0%;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 12rem; /* Add padding to prevent overlap with footer */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Chat Bubble Styling */
.chat-bubble {
    display: flex;
    width: 100%;
    max-width: 100%;
}
.chat-bubble.user { justify-content: flex-end; }
.chat-bubble.model { justify-content: flex-start; }

.chat-bubble-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1.5rem; /* rounded-xl is not standard, using a more rounded look */
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
}
.chat-bubble.user .chat-bubble-content {
    background-color: #111827; /* bg-gray-900 */
    color: #f9fafb; /* text-gray-50 */
    border-bottom-right-radius: 0;
}
.chat-bubble.model .chat-bubble-content {
    background-color: #e5e7eb; /* bg-gray-200 */
    color: #111827; /* text-gray-900 */
    border-bottom-left-radius: 0;
}
.chat-bubble-content p { margin: 0 0 0.5rem 0; }
.chat-bubble-content p:last-child { margin-bottom: 0; }
.chat-bubble-content h1, .chat-bubble-content h2, .chat-bubble-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.chat-bubble-content ul, .chat-bubble-content ol {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.chat-bubble-content pre {
    background-color: #1f2937;
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: monospace;
}
.chat-bubble-content code {
    font-family: monospace;
    background-color: rgba(0,0,0,0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
}
.chat-bubble-content pre code {
    background-color: transparent;
    padding: 0;
}


/* Footer and Input Area */
footer {
    background-color: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
    flex-shrink: 0;
    position: relative;
}
footer > .max-w-3xl {
    max-width: 48rem; /* 3xl */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
#chat-form {
    width: 100%;
    display: flex;
    gap: 0.5rem;
}
#chat-input {
    flex: 1 1 0%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem; /* rounded-xl */
    border: none;
    background-color: #f3f4f6; /* bg-gray-100 */
    resize: none;
    min-height: 3rem; /* h-12 */
    max-height: 8rem; /* Limit height to approx 5 lines */
    overflow-y: auto; /* Enable scrolling */
    transition: all 0.2s;
    font-size: 1rem;
}
#chat-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6; /* ring-2 focus:ring-blue-500 */
}
#chat-input.listening {
    background-color: #fee2e2; /* bg-red-50 */
    box-shadow: 0 0 0 2px #fca5a5; /* ring-2 ring-red-200 */
}

#send-button {
    background-color: #111827; /* bg-gray-900 */
    color: white;
    padding: 0.75rem;
    border-radius: 0.75rem; /* rounded-xl */
    border: none;
    cursor: pointer;
    align-self: flex-end;
    transition: background-color 0.2s;
}
#send-button:hover { background-color: #1f2937; }
#send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Voice Indicator */
#voice-indicator-container {
    align-self: flex-end;
}
.voice-indicator {
    padding: 0.75rem;
    border-radius: 0.75rem; /* rounded-xl */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f3f4f6; /* bg-gray-100 */
}
.voice-indicator svg {
    width: 1.5rem; /* h-6 w-6 */
    height: 1.5rem;
}
.voice-indicator:hover { background-color: #e5e7eb; }
.voice-indicator.listening { background-color: #ef4444; color: white; }
.voice-indicator.speaking { background-color: #3b82f6; color: white; }
.voice-indicator.processing { background-color: #6b7280; color: white; cursor: not-allowed; }

/* Suggestion Chips */
#suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.suggestion-chip {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background-color: #e5e7eb; /* bg-gray-200 */
    color: #374151; /* text-gray-700 */
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.suggestion-chip:hover {
    background-color: #d1d5db; /* hover:bg-gray-300 */
    border-color: #9ca3af;
}

/* Loading animation for model response */
.loading-dots {
    display: flex;
    justify-content: flex-start;
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.loading-dots > div {
    display: flex;
    gap: 0.25rem;
    background-color: #e5e7eb;
    padding: 0.75rem 1rem;
    border-radius: 1.5rem;
    border-bottom-left-radius: 0;
}
.loading-dots span {
    width: 0.5rem; /* w-2 */
    height: 0.5rem; /* h-2 */
    background-color: #9ca3af; /* bg-gray-400 */
    border-radius: 9999px;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Markdown table styling */
table {
  width: auto;
  border-collapse: collapse;
  margin: 1rem 0;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  border-radius: 0.5rem;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
th {
  background-color: #f3f4f6;
  font-weight: 600;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr:hover {
  background-color: #f9fafb;
}

/* Final text utility */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-gray-400 { color: #9ca3af; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }

/* Icon sizing utilities */
.h-6 { height: 1.5rem; }
.w-6 { width: 1.5rem; }
.h-5 { height: 1.25rem; } /* Added */
.w-5 { width: 1.25rem; } /* Added */
.h-8 { height: 2rem; }
.w-8 { width: 2rem; }

/* Utility class for hiding elements */
.hidden { display: none !important; }

/* New utility classes for padding and border-radius (Tailwind-like) */
.p-2 { padding: 0.5rem; } /* Added */
.rounded-full { border-radius: 9999px; } /* Added */

/* --- TTS & Settings --- */

#main-header .flex {
    align-items: center;
}

#clear-chat-button, #settings-button {
    border: none;
    background: none;
    cursor: pointer;
}

/* Settings Panel */
#tts-settings-panel {
    padding: 1rem; /* p-4 */
}

/* Modal styles for the settings panel */
#tts-settings-modal-overlay {
    background-color: rgba(0, 0, 0, 0.5); /* bg-black bg-opacity-50 */
    /* Add animation for fade in/out if desired */
}


/* Read Aloud button on chat bubbles */
.read-aloud-button {
    position: absolute;
    bottom: -0.25rem;
    right: -0.25rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 2rem; /* h-8 w-8 */
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    transition: all 0.2s; /* Keep transition for other effects */
    opacity: 1; /* Always visible */
    transform: scale(1); /* Always full size */
}
.read-aloud-button.active svg {
    color: #3b82f6; /* bg-blue-500 */
}
.read-aloud-button:hover {
    background-color: #f3f4f6;
}

.read-aloud-button svg {
    width: 1rem;
    height: 1rem;
    color: #4b5563;
}
.read-aloud-button.speaking svg {
    color: #3b82f6;
}. l i m i t - e x c e e d e d   {   c o l o r :   # e f 4 4 4 4 ;   }  
 