body {
  font-family: 'Inter', 'Segoe UI', 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background: #1a1a1b; /* Slightly adjusted dark background */
  color: var(--blue-font); /* Light default text */
  /* Remove flex centering from body, apply to wrapper */
  /* display: flex; */
  /* justify-content: center; */
  /* align-items: center; */
  /* min-height: 100vh; */
}

/* New App Wrapper */
.app-wrapper {
  display: flex;
  flex-direction: column; /* Stack settings bar and chat container vertically */
  min-height: 100vh;
  width: 100%;
  /* Remove min-height if present, let .chat-container control height */
}

/* Remove sidebar styles */
.sidebar {
  display: none !important;
}

/* Settings bar at the top */
.settings-bar {
  display: flex;
  gap: 0.5em; /* Reduce gap between buttons */
  padding: 0.7em 1.2em 0.3em 1.2em; /* Reduce top/bottom padding */
  background: linear-gradient(to right, #23232a, #23232a 80%, #23232a 100%);
  border-bottom: 1px solid #383838;
  align-items: flex-start; /* Align buttons to the top */
  justify-content: flex-start;
  z-index: 10;
}

.settings-bar h1 {
  color: #ffffff;
  font-weight: 500;
  font-size: 1.5em;
  margin: 0 1.2em 0 0; /* Reduce right margin */
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
}

.settings-btn {
  font-family: inherit;
  padding: 0.5em 0.9em; /* Smaller buttons */
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.92em;
  font-weight: 500;
  color: #c5c7ca;
  display: flex;
  align-items: center;
  gap: 0.7em;
  transition: color 0.2s, background-color 0.2s, transform 0.1s;
}

.settings-btn:hover {
  color: #ffffff;
  background-color: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}

.settings-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}


@media (max-width: 768px) {
  .settings-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3em;
    padding: 0.5em 0.5em 0.2em 0.5em; /* Reduce padding on mobile */
  }
}

h1 {
  color: #ffffff; /* White heading */
  font-weight: 500;
  margin: 0;
  font-size: 1.8em;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.2); /* Subtle text shadow */
}

label {
  display: block;
  margin-bottom: 0.5em; /* Slightly more space */
  font-weight: 500;
  font-size: 0.9em;
  color: #b0b0b0; /* Lighter grey label */
}

/* Apply styles to select element as well */
input[type="text"], textarea, select {
  width: 100%;
  padding: 0.9em 1.1em; /* Slightly more padding */
  margin-top: 0;
  border-radius: 10px; /* Slightly more rounded */
  border: 1px solid #444; /* Darker border */
  font-size: 1em;
  box-sizing: border-box;
  background-color: #2a2a2a; /* Dark input background */
  color: #e0e0e0; /* Light input text */
  transition: border-color 0.2s ease, box-shadow 0.2s ease; /* Smooth transition */
  font-family: inherit; /* Ensure font consistency */
  appearance: none; /* Remove default system appearance */
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23b0b0b0" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); /* Custom dropdown arrow */
  background-repeat: no-repeat;
  background-position: right 1.1em center;
  background-size: 1.2em;
  padding-right: 3em; /* Make space for the arrow */
  height: 3.5em; /* Explicit height for consistency */
  line-height: 1.5; /* Adjust line height */
}

/* Specific styles for date input */
input[type="date"].date-input {
  width: auto; /* Adjusted from 50% to auto or a fixed width if preferred */
  min-width: 150px; /* Ensure it has a minimum width */
  padding: 1em 1.2em; /* Increased padding */
  margin-top: 0;
  border-radius: 10px;
  border: 1px solid #444;
  font-size: 1em; /* Increased font size */
  box-sizing: border-box;
  background-color: #2a2a2a;
  color: #e0e0e0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  height: 2.4em; /* Increased height */
  line-height: 1.5;
  color-scheme: dark; /* Helps with browser-native date picker theme */
}

input[type="date"].date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.8); /* Make the calendar icon lighter on dark background */
}

/* New styles for the date and age display container */
.date-age-container {
  display: flex;
  align-items: center; /* Vertically align items */
  gap: 1em; /* Space between date input and age display */
}

.date-input-container {
  flex-shrink: 0; /* Prevent date input from shrinking too much */
}

.age-display {
  font-size: 0.9em;
  color: #c0c0c0; /* Light grey for age text */
  padding: 0.5em;
  background-color: #2a2a2a; /* Match input background */
  border-radius: 8px;
  border: 1px solid #444;
  white-space: nowrap; /* Prevent text from wrapping */
  flex-shrink: 0;
}

/* Style for disabled option */
select option[disabled] {
    color: #888;
}

/* Style for options */
select option {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

textarea {
  resize: vertical;
  min-height: 45px; /* Slightly taller */
  line-height: 1.5; /* Better text spacing */
}

/* Apply focus styles to select */
input[type="text"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue-main-light);
  box-shadow: 0 0 0 2px rgba(58, 123, 224, 0.18);
}

/* General button styling (can apply to reset/instructions/modal buttons) */
/* Keep this for modal buttons, but sidebar buttons are styled separately now */
button {
  font-family: inherit;
  padding: 0.5em 1em;
  border-radius: 8px;
  border: 1px solid #444;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.loading {
  color: #ffffff; /* Change from blue to white for loading text */
  font-style: italic;
  display: flex;
  align-items: center;
  animation: pulse 1.5s infinite;
}

/* New loading spinner animation */
.loading:before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  to {transform: rotate(360deg);}
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 1em;
  border: 1px solid #444; /* Darker border */
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  border: 1px solid #444; /* Darker border */
  padding: 0.8em 1em;
  text-align: left;
  font-size: 0.95em;
}

th {
  background: #2a2a2a; /* Dark header background */
  font-weight: 500;
  color: #e0e0e0; /* Light header text */
}

td {
  background: #1e1e1e; /* Slightly lighter dark for cells */
  color: #d0d0d0; /* Slightly dimmer text in cells */
}

.error {
  color: #ff8a80; /* Lighter red for errors */
  margin-top: 1em;
  font-weight: 500;
}

.chat-container {
  flex-grow: 1;
  background: #1e1e1f; /* Slightly adjusted chat area background */
  padding: 1em 1.2em 1em 1.2em; /* Reduce padding */
  border-radius: 0; /* Remove radius if it's full height */
  box-shadow: none; /* Remove shadow if sidebar has it */
  display: flex;
  flex-direction: column;
  height: calc(100vh - 54px); /* Subtract top bar height (adjust as needed) */
  box-sizing: border-box;
  position: relative; /* Needed for modal positioning context if not full screen */
  overflow: hidden; /* Prevent content overflow issues */
  width: 100%;
}

.header {
  display: flex;
  /* Adjust alignment if only title remains */
  justify-content: flex-start; /* Or center */
  align-items: center;
  margin-bottom: 1em; /* Keep this */
  padding-bottom: 1em; /* Keep this */
  border-bottom: 1px solid #383838; /* Slightly lighter border */
  flex-shrink: 0; /* Prevent header from shrinking */
}

/* Remove header-buttons styles */
/* .header-buttons { ... } */

.description {
  font-size: 0.95em;
  color: #a0a0a0; /* Lighter secondary text */
  margin-bottom: 1.5em;
  flex-shrink: 0; /* Prevent description from shrinking */
}

.child-info-form {
  display: flex;
  flex-direction: column; /* Stack fields vertically on small screens */
  gap: 0.7em; /* Reduce gap between form groups */
  margin-bottom: 1.2em;
  align-items: stretch; /* Stretch items vertically by default */
  flex-shrink: 0; /* Prevent form from shrinking */
}

/* Use media query for larger screens */
@media (min-width: 768px) { /* Adjusted breakpoint for better layout */
  .child-info-form {
    flex-direction: row; /* Side-by-side on larger screens */
    gap: 1.5em;
    align-items: flex-end; /* Align items to the bottom */
  }
  .age-group {
      flex: 1 1 30%; /* Adjust flex basis for age */
  }
  .vaccine-group {
      flex: 1 1 70%; /* Adjust flex basis for vaccines */
      /* Remove default flex alignment if needed */
      /* align-self: auto; */
  }
}

.form-group {
  flex: 1;
  /* Add min-width for better wrapping behavior if needed */
  min-width: 150px;
  display: flex; /* Use flexbox for label + input alignment */
  flex-direction: column; /* Stack label above input */
  margin-bottom: 0.5em; /* Reduce bottom margin */
}

.chat-history {
  flex: 1 1 auto; /* Keep this */
  overflow-y: auto;
  margin-bottom: 1.5em;
  padding-right: 10px;
  /* Remove height adjustments if flex handles it */
}

/* Style scrollbar for dark theme */
.chat-history::-webkit-scrollbar {
  width: 8px;
}
.chat-history::-webkit-scrollbar-track {
  background: #2a2a2a; /* Dark track */
  border-radius: 4px;
}
.chat-history::-webkit-scrollbar-thumb {
  background: var(--blue-main-dark);
  border-radius: 4px;
}
.chat-history::-webkit-scrollbar-thumb:hover {
  background: var(--blue-main);
}

.chat-message {
  margin-bottom: 1.5em;
  display: flex;
}

.chat-message.user { /* Ensure user messages align to the right */
  justify-content: flex-end;
}

.chat-message.assistant { /* Ensure assistant messages align to the left */
  justify-content: flex-start;
}

/* Chat bubble general styles - keep for user messages only */
.chat-bubble {
  max-width: 80%;
  padding: 0.8em 1.2em;
  border-radius: 18px;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15); /* Add subtle shadow to bubbles */
}

/* User chat bubble (keep the bubble style) */
.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, var(--blue-main), var(--blue-main-dark));
  color: #e3f2fd; /* Light blue text */
  border-bottom-right-radius: 4px; /* Tail on the right */
}

/* Assistant message - make text white for better contrast */
.chat-message.assistant .chat-bubble {
  background: none !important; /* Remove background for all assistant messages */
  color: var(--blue-font);
  border-bottom-left-radius: 0;
  box-shadow: none;
  padding-left: 0;
  max-width: 95%; /* Allow more width for assistant messages */
}

/* Style for the plan-answer is already set to have no background, so we can keep it as is */
.chat-message.assistant.plan-answer .chat-bubble {
  background: none !important; /* Ensure no background */
  border-bottom-left-radius: 0;
  box-shadow: none;
  padding-left: 0;
}

/* Remove background from the parent message div as well */
.chat-message.assistant {
  background: none !important; /* Ensure no background for all assistant messages */
  /* color is inherited or set on the bubble */
}

/* Markdown elements in assistant messages - adjust strong color if needed */
.chat-message.assistant .chat-bubble p { margin: 0 0 0.8em 0; line-height: 1.5; }
.chat-message.assistant .chat-bubble p:last-child { margin-bottom: 0; }
.chat-message.assistant .chat-bubble ul, 
.chat-message.assistant .chat-bubble ol { margin: 0.8em 0 0.8em 1.5em; padding-left: 0.5em; }
.chat-message.assistant .chat-bubble li { margin-bottom: 0.4em; line-height: 1.5; }
.chat-message.assistant .chat-bubble strong { font-weight: 500; color: #ffffff; }

/* Tables need borders even without bubble background */
.chat-message.assistant .chat-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
  background-color: rgba(30, 30, 35, 0.3); /* Very subtle background for tables */
}

.chat-message.assistant .chat-bubble th {
  background-color: #444;
  color: #f0f0f0;
  font-weight: 600;
  border: 1px solid #555;
  padding: 0.7em 0.8em;
}

.chat-message.assistant .chat-bubble td {
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #555;
  padding: 0.7em 0.8em;
}

/* Markdown elements in dark theme */
.chat-bubble p { margin: 0 0 0.8em 0; line-height: 1.5; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble ul, .chat-bubble ol { margin: 0.8em 0 0.8em 1.5em; padding-left: 0.5em; }
.chat-bubble li { margin-bottom: 0.4em; line-height: 1.5; }
.chat-bubble strong { font-weight: 500; color: #ffffff; } /* Brighter bold */
.chat-bubble code {
  background-color: #444; /* Darker code background */
  color: #c5c8c6; /* Light code text */
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.9em;
}
.chat-bubble pre {
  background-color: #2a2a2a; /* Dark pre background */
  color: #c5c8c6; /* Light pre text */
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9em;
  border: 1px solid #444;
}
.chat-bubble pre code {
  background-color: transparent;
  padding: 0;
  border: none;
}
.chat-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
}
.chat-bubble th, .chat-bubble td {
  border: 1px solid #555;
  padding: 0.7em 0.8em;
  text-align: left;
  font-size: 0.93em;
  line-height: 1.4;
}
.chat-bubble th {
  background-color: #444;
  color: #f0f0f0;
  font-weight: 600;
}
.chat-bubble td {
  background-color: #333;
  color: #e0e0e0;
}
.chat-bubble h1, .chat-bubble h2, .chat-bubble h3, 
.chat-bubble h4, .chat-bubble h5, .chat-bubble h6 {
  margin: 1.2em 0 0.7em 0;
  line-height: 1.3;
}
.chat-bubble h1:first-child, .chat-bubble h2:first-child, 
.chat-bubble h3:first-child, .chat-bubble h4:first-child {
  margin-top: 0.4em;
}

.chat-input-row {
  display: flex;
  gap: 0.8em;
  align-items: center;
  padding: 0.6em; /* Slightly more padding */
  border: none; /* Remove border */
  border-radius: 28px; /* More rounded pill shape */
  background-color: var(--blue-bg-light); /* Slightly adjusted input row background */
  box-shadow: 0 3px 8px rgba(0,0,0,0.3); /* Enhanced shadow */
  flex-shrink: 0; /* Prevent input row from shrinking */
}

.chat-input { /* Input field within the row */
  flex: 1 1 auto;
  padding: 0.8em 1em;
  border-radius: 0;
  border: none;
  background-color: transparent;
  font-size: 1em;
  margin: 0;
  outline: none;
  color: #e8eaed; /* Ensure good contrast */
}

.chat-input::placeholder { /* Style placeholder */
    color: #888;
}

.chat-send-btn {
  background: linear-gradient(135deg, #6a95ff, #6289ff); /* Gradient for send button */
  color: #121212; /* Dark icon for contrast */
  border: none;
  border-radius: 50%;
  padding: 0;
  width: 44px; /* Slightly larger */
  height: 44px; /* Slightly larger */
  font-size: 1em;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, #7ca5ff, #7095ff); /* Brighter gradient on hover */
  transform: scale(1.05); /* Slight scale effect */
}

.chat-send-btn:disabled {
  background: #444; /* Dark grey disabled */
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chat-send-btn svg {
  fill: #1e1e1e; /* Dark icon */
  width: 22px; /* Adjust icon size */
  height: 22px;
}

.chat-send-btn:disabled svg {
  fill: #888; /* Dimmer icon when disabled */
}

/* Remove specific styles for buttons now in sidebar */
/* .reset-btn { ... } */
/* .instructions-btn { ... } */
/* .files-btn { ... } */

/* Modal Styles */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
  padding-top: 60px; /* Location of the box */
}

.modal-content {
  background-color: #2e2e30; /* Slightly adjusted modal background */
  color: #e0e0e0;
  margin: 5% auto; /* 5% from the top and centered */
  padding: 25px;
  border: 1px solid #5a5a5a; /* Slightly lighter border */
  border-radius: 12px;
  width: 80%; /* Could be more or less, depending on screen size */
  max-width: 600px; /* Maximum width */
  position: relative;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5); /* Enhanced modal shadow */
  display: flex; /* Use flexbox for layout */
  flex-direction: column; /* Stack content vertically */
}

.modal-content.large { /* Style for wider modals */
    max-width: 800px;
    width: 90%;
}

.modal-close {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
  color: #fff;
  text-decoration: none;
}

.modal h2 {
  margin-top: 0;
  color: #ffffff;
  border-bottom: 1px solid #444;
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

.modal p {
  color: #b0b0b0;
  font-size: 0.95em;
  margin-bottom: 1em;
}

.modal textarea { /* Style textarea within modal */
  width: 100%;
  padding: 0.8em 1em;
  margin-bottom: 1.5em;
  border-radius: 8px;
  border: 1px solid #444;
  background-color: #1e1e1e; /* Slightly darker than modal bg */
  color: #e0e0e0;
  font-size: 0.95em;
  min-height: 150px;
  box-sizing: border-box;
}

.modal textarea:focus {
  border-color: #6289ff;
  box-shadow: 0 0 0 2px rgba(98, 137, 255, 0.3);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1em;
  margin-top: 1em;
}

.modal-save-btn {
  background-color: var(--blue-main); /* Blue save button */
  color: #121212;
  border-color: var(--blue-main-dark);
}

.modal-save-btn:hover {
  background-color: var(--blue-main-hover);
  border-color: var(--blue-main-light);
}

.modal-cancel-btn {
  background-color: #444; /* Grey cancel button */
  color: #e0e0e0;
  border-color: #555;
}

.modal-cancel-btn:hover {
  background-color: #555;
  border-color: #666;
}

.modal-status {
    margin-top: 1em;
    font-size: 0.9em;
    min-height: 1.2em; /* Reserve space */
    text-align: right;
    color: #8ab4f8; /* Default status color */
}

.modal-status.error {
    color: #ff8a80; /* Error status color */
}

/* Files Modal Specific Styles */
.file-list-container {
    margin-bottom: 1.5em;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1em;
    background-color: #1e1e1e; /* Slightly darker background for list area */
    max-height: 300px; /* Limit height and make scrollable */
    overflow-y: auto;
}

.file-list-container h3 {
    margin-top: 0;
    margin-bottom: 0.8em;
    color: #e0e0e0;
    font-size: 1.1em;
}

#file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6em 0.8em;
    border-bottom: 1px solid #333;
    font-size: 0.95em;
}

#file-list li:last-child {
    border-bottom: none;
}

#file-list span { /* Filename */
    flex-grow: 1;
    margin-right: 1em;
    word-break: break-all; /* Prevent long filenames from overflowing */
}

#file-list .file-actions button {
    margin-left: 0.5em;
    padding: 0.3em 0.8em;
    font-size: 0.85em;
}

.file-actions .view-edit-btn {
    background-color: #4a4a4a;
    color: #e0e0e0;
    border-color: #555;
}
.file-actions .view-edit-btn:hover {
    background-color: #5a5a5a;
}

.file-actions .delete-btn {
    background-color: #7d3c3c; /* Dark red */
    color: #f0d0d0;
    border-color: #8d4c4c;
}
.file-actions .delete-btn:hover {
    background-color: #9d4c4c;
}

.upload-section {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #333;
}

.upload-section h3 {
    margin-top: 0;
    margin-bottom: 0.8em;
    color: #e0e0e0;
    font-size: 1.1em;
}

#file-upload-input {
    display: block;
    margin-bottom: 1em;
    color: #b0b0b0; /* Style file input text */
}

/* Style file input button */
#file-upload-input::file-selector-button {
    font-family: inherit;
    padding: 0.5em 1em;
    border-radius: 8px;
    border: 1px solid #444;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    background: #303134;
    color: #bdc1c6;
    margin-right: 1em;
}

#file-upload-input::file-selector-button:hover {
    background: #3c4043;
    border-color: #555;
}

.modal-action-btn { /* General style for action buttons like Upload */
    background-color: var(--blue-main);
    color: #121212;
    border-color: var(--blue-main-dark);
}
.modal-action-btn:hover {
    background-color: var(--blue-main-hover);
    border-color: var(--blue-main-light);
}

/* File Editor Modal Styles */
#file-editor-title {
    margin-top: 0;
    color: #ffffff;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5em;
    margin-bottom: 1em;
}

#file-editor-textarea {
    width: 100%;
    padding: 0.8em 1em;
    margin-bottom: 1.5em;
    border-radius: 8px;
    border: 1px solid #444;
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-size: 0.95em;
    min-height: 300px; /* Taller editor */
    box-sizing: border-box;
    font-family: monospace; /* Use monospace for editing */
}

#file-editor-textarea:focus {
    border-color: #6289ff;
    box-shadow: 0 0 0 2px rgba(98, 137, 255, 0.3);
}

/* Ensure button base styles are defined if needed elsewhere */
button {
  /* Basic button reset if needed */
  font-family: inherit;
}


/* New styles for age selection */
.age-group label {
  margin-bottom: 0.5em; /* Consistent spacing */
}

.age-selects {
  display: flex;
  gap: 0.8em; /* Space between year and month dropdowns */
}

.age-selects select {
  flex: 1; /* Make dropdowns share space */
  min-width: 80px; /* Ensure dropdowns don't get too small */
}

/* Adjust padding for select with arrow */
select {
  /* ... existing select styles ... */
  padding: 0.9em 3em 0.9em 1.1em; /* Ensure right padding accommodates arrow */
}

/* New styles for vaccine selection */
.vaccine-group { /* Adjust vaccine group layout */
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.vaccine-group label {
  margin-bottom: 0.3em;
}

#previous-vaccines-list {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  margin-bottom: 0; /* Ensure space between list and button */
}

.vaccine-entry {
  display: flex;
  gap: 0.5em;
  align-items: center; /* Vertically center items in the row */
  padding: 0.2em 0.1em;
  font-size: 0.97em;
}

.vaccine-entry select {
  flex: 1; /* Allow dropdowns to grow */
  height: 3.5em; /* Ensure consistent height */
}

.vaccine-entry .vaccine-select {
  min-width: 200px; /* Give more space to vaccine name */
}

.vaccine-entry .dose-select {
  min-width: 80px;
}

.remove-vaccine-btn {
  background-color: #7d3c3c; /* Dark red */
  color: #f0d0d0;
  border-color: #8d4c4c;
  padding: 0.4em 0.8em; /* Slightly smaller padding */
  font-size: 0.85em;
  flex-shrink: 0; /* Prevent button from shrinking */
}
.remove-vaccine-btn:hover {
    background-color: #9d4c4c;
}

.add-btn { /* Style for Add Vaccine button (now opens modal) */
  /* Match select styles */
  background-color: #2a2a2a; /* Match select background */
  color: #e0e0e0; /* Match select text color */
  border: 1px solid #444; /* Match select border */
  border-radius: 10px; /* Match select border-radius */
  padding: 0 0.9em; /* Match horizontal padding of select */
  font-size: 0.97em; /* Match select font-size */
  cursor: pointer;
  font-weight: 500; /* Keep button font-weight */
  transition: background-color 0.2s ease, border-color 0.2s ease;
  display: inline-block; /* Make it fit content width */
  height: 2.6em; /* Match height of selects */
  line-height: 2.6em; /* Vertically center text using line-height */
  text-align: center; /* Center text horizontally */
  margin-top: 0; /* Keep or adjust as needed */
  /* Remove align-self: flex-start; */
  white-space: nowrap; /* Prevent text wrapping */
}

.add-btn:hover {
  background: #3c4043; /* Slightly lighter grey on hover */
  border-color: #555; /* Slightly lighter border on hover */
  color: #ffffff; /* Slightly brighter text on hover */
}

/* Add Vaccine Modal Styles */
#add-vaccine-modal .modal-content {
    max-width: 500px; /* Adjust width as needed */
}

.add-vaccine-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
    margin-bottom: 1.5em;
}

.add-vaccine-form .form-group {
    flex: 1;
    min-width: 0; /* Override previous min-width if needed */
}

/* New styles for medical conditions container */
#medical-conditions-container {
  max-height: 100px; /* Adjust as needed */
  overflow-y: auto;
  padding: 0.8em;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #2a2a2a; /* Match other input backgrounds */
  margin-top: 0.3em; /* Align with other inputs */
  display: block; /* Changed from flex to block for proper vertical stacking */
}

#medical-conditions-container label {
  display: flex; /* I want the to be inline */
  justify-content: space-between; /* Space between checkbox and label */
  width: 100%; /* Full width for label */
  padding: 0.5em 0.8em; /* Padding for each item */
  align-items: center;
  margin-bottom: 0.6em; /* Space between items */
  font-size: 0.95em;
  color: #e0e0e0; /* Light text */
  cursor: pointer;
}

#medical-conditions-container input[type="checkbox"] {
  margin-right: 0.7em;
  /* Optional: Style checkbox appearance if desired, though browser defaults are often fine */
  width: 16px;
  height: 16px;
  accent-color: var(--blue-main); /* Color the checkbox when checked */
}


/* New compact vaccine selection panel styles */
.vaccine-selection-panel {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5em;
  border: 1px solid #444;
  border-radius: 10px;
  background-color: #2a2a2a;
}

.vaccine-selection-panel .vaccine-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7em;
  padding: 0.3em 0.5em;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.vaccine-selection-panel .vaccine-item:last-child {
  margin-bottom: 0;
}

.vaccine-selection-panel .vaccine-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1em;
}

.vaccine-selection-panel .dose-select {
  width: auto;
  min-width: 100px;
  max-width: 120px;
  height: 2.5em;
  padding: 0.3em 2em 0.3em 0.8em;
  margin-left: 0.5em;
  flex: 0 0 auto;
}

/* Add visual indication for items where a dose is selected */
.vaccine-selection-panel .vaccine-item.selected {
  background-color: rgba(58, 123, 224, 0.15);
  border: 1px solid rgba(58, 123, 224, 0.3);
}

.vaccine-selection-panel .all-up-to-date-option {
  border-bottom: 1px solid #444;
  margin-bottom: 1em;
  padding-bottom: 0.7em;
}

.vaccine-selection-panel .all-up-to-date-option label {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  cursor: pointer;
}

.add-vaccine-form select {
    /* Styles already defined, ensure height is consistent */
    height: 3.5em;
}

/* Media query adjustments if needed */
/* Consider hiding/collapsing sidebar on smaller screens */
@media (max-width: 768px) {
  .app-wrapper {
    flex-direction: column; /* Stack sidebar and content */
  }
  .sidebar {
    width: 100%; /* Full width */
    height: auto; /* Auto height */
    border-right: none;
    border-bottom: 1px solid #333;
    flex-direction: row; /* Arrange items horizontally */
    flex-wrap: wrap; /* Allow wrapping */
    justify-content: center; /* Center buttons */
    padding: 0.8em;
  }
  .sidebar h2 {
      display: none; /* Hide title on small screens */
  }
  .sidebar-btn {
      width: auto; /* Auto width for buttons */
      flex-grow: 1; /* Allow buttons to grow */
      text-align: center; /* Center text */
      min-width: 120px; /* Minimum width */
  }
  .chat-container {
      height: auto; /* Adjust height */
      min-height: 60vh;
      padding: 0.7em 0.5em 0.7em 0.5em;
      flex-grow: 1; /* Take remaining space */
  }
}

/* ... other existing media queries ... */
@media (min-width: 600px) {
/* ... existing media query styles ... */
  /* Remove or comment out flex-grow if it causes issues */
  /* .vaccine-group {
      flex-grow: 2;
  } */
}

/* Thinking Steps Styles */
.thinking-steps {
  background: rgba(30, 30, 35, 0.75);
  border-radius: 12px;
  padding: 1.2em 1.5em;
  margin-bottom: 1.5em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  max-width: 80%;
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.thinking-title {
  display: flex;
  align-items: center;
  color: #8ab4f8;
  font-weight: 500;
  margin-bottom: 1em;
  font-size: 0.95em;
}

.thinking-title svg {
  margin-right: 0.5em;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.thinking-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.thinking-step {
  display: flex;
  align-items: flex-start;
  color: rgba(224, 224, 224, 0.5);
  transition: color 0.3s ease;
}

.thinking-step.active {
  color: #e0e0e0;
}

.thinking-step.completed {
  color: rgba(138, 180, 248, 0.8);
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 1em;
  min-width: 20px;
}

.step-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  margin-bottom: 0.2em;
  transition: background-color 0.3s ease;
}

.thinking-step.active .step-circle {
  background-color: #8ab4f8;
  border-color: #8ab4f8;
  box-shadow: 0 0 0 4px rgba(138, 180, 248, 0.15);
}

.thinking-step.completed .step-circle {
  background-color: #8ab4f8;
  border-color: #8ab4f8;
}

.step-line {
  width: 2px;
  height: 20px;
  background-color: rgba(224, 224, 224, 0.2);
}

.thinking-step:last-child .step-line {
  display: none;
}

.thinking-step.active .step-line,
.thinking-step.completed .step-line {
  background-color: rgba(138, 180, 248, 0.5);
}

.step-content {
  padding: 0.2em 0;
  font-size: 0.9em;
}

/* Modify loading bubble to blend with thinking steps */
.loading-bubble {
  background: rgba(30, 30, 35, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  opacity: 0;
  height: 0;
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
  transition: opacity 0.3s ease;
}

/* Help Modal Styles */
#help-modal .modal-content {
  max-width: 600px;
  width: 90%;
}

#help-modal h2 {
  margin-top: 0;
}

#help-modal ul {
  margin: 0 0 1em 1.5em;
  padding: 0;
  color: #b0b0b0;
  font-size: 0.97em;
}

#help-modal p {
  color: #b0b0b0;
  margin-bottom: 1em;
}

#help-modal strong {
  color: #fff;
}

#help-modal .modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1em;
  margin-top: 1em;
}

/* Main Content Styles */
.main-content {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 54px); /* Subtract top bar height */
  width: 100%;
  position: relative;
}

.left-section {
  flex: 0 0 33.33%;   /* Use 1/3 of the width */
  min-width: 280px;    /* Optional: prevent too small on small screens */
  max-width: 480px;    /* Optional: prevent too wide on large screens */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #202024;
  border-right: none;
  padding: 1.2em 1.5em 1.2em 1.5em;
  justify-content: flex-start;
}

.right-section {
  flex: 1 1 66.66%;    /* Use 2/3 of the width */
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: none;
  padding: 1.2em 1.5em 1.2em 1.5em;
  justify-content: flex-start;
  position: relative;
  color: var(--blue-font);
  box-shadow: -8px 0 24px -16px rgba(58,123,224,0.08);
}



.child-info-form {
  flex-direction: column;
  gap: 1em;
  margin-bottom: 1.5em;
  align-items: stretch;
}

#initial-form {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  flex: 1 1 auto;
}

#initial-send-btn {
  align-self: flex-end;
  margin-top: 1em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: linear-gradient(135deg, #3ecf8e, #2eb872);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px; /* Slightly larger */
  height: 44px; /* Slightly larger */
  font-size: 1em;
  font-weight: 500;
  padding: 0.7em 1.5em;
  box-shadow: 0 1px 3px rgba(46, 184, 114, 0.15);
  transition: background 0.2s, transform 0.1s;
}

#initial-send-btn:hover {
  background: linear-gradient(135deg, #43e697, #38c47c);
  color: #fff;
  transform: translateY(-2px) scale(1.03);
}

#initial-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin-right: 0.3em;
}

/* Remove default button border on focus */
#initial-send-btn:focus {
  outline: none;
  border: none;
}

#initial-query-input {
  height: 2.2em !important;
  min-height: 0 !important;
  padding: 0.5em 1em !important;
  font-size: 1em;
  background-image: none !important; /* Remove dropdown arrow */
  padding-right: 1em !important; /* Remove extra space for arrow */
  box-shadow: none;
}

#initial-query-input {
  margin-top: 0.3em;
}

.right-section .chat-history {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-bottom: 1.2em;
  padding-right: 10px;
  background: transparent;
}

#followup-chat-form {
  display: flex;
  gap: 0.8em;
  align-items: center;
  border-radius: 28px;
  background-color: #2f2f31;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  padding: 0.6em;
  margin-top: 0;
  margin-bottom: 0;
  position: relative;
  width: 50%; /* Reduce width to 50% */
  display: block;
  margin-left: auto;
  margin-right: auto;
  /* To align left (default), no change. To center: margin-left: auto; margin-right: auto; */
}

#followup-chat-input {
  flex: 1 1 auto;
  padding: 0.8em 1em;
  border-radius: 0;
  border: none;
  background-color: transparent;
  font-size: 1em;
  margin: 0;
  outline: none;
  color: #e8eaed;
  background-image: none !important; /* Remove arrow background image */
  padding-right: 1em !important; /* Reset padding adjusted for arrow */
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#followup-send-btn {
  background: var(--blue-main-gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 1px 3px rgba(36, 81, 166, 0.15);
  transition: background 0.2s, transform 0.1s;
}

#followup-send-btn:hover {
  background: var(--blue-main-gradient-hover);
  color: #fff;
  transform: scale(1.05);
}

#followup-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin: 0;
}

@media (max-width: 900px) {
  .main-content {
    flex-direction: column;
    height: auto;
  }
  .left-section, .right-section {
    width: 100%;
    min-width: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #333;
    padding: 1em 0.7em;
  }
  .right-section {
    border-bottom: none;
  }
}

/* Improved Get Plan button: dark green, round, icon-only on desktop, full width on mobile */
#initial-send-btn {
  background: linear-gradient(135deg, #217a4b, #1e5e3b);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 1px 3px rgba(33, 122, 75, 0.15);
  transition: background 0.2s, transform 0.1s;
  margin-top: 0.2em;
}

#initial-send-btn:hover {
  background: linear-gradient(135deg, #299e5e, #217a4b);
  color: #fff;
  transform: scale(1.05);
}

#initial-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin: 0;
}

#initial-send-btn span {
  display: none;
  font-size: 0.97em;
}

@media (max-width: 900px) {
  #initial-send-btn {
    border-radius: 8px;
    width: 100%;
    min-width: 0;
    min-height: 38px;
    height: 38px;
    justify-content: center;
    gap: 0.5em;
    padding: 0.5em 0;
  }
  #initial-send-btn span {
    display: inline;
    font-size: 0.97em;
    font-weight: 500;
    margin-left: 0.4em;
  }
}

/* Chat send button: blue, round, check-circle icon style */
#followup-send-btn {
  background: var(--blue-main-gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 1px 3px rgba(36, 81, 166, 0.15);
  transition: background 0.2s, transform 0.1s;
}

#followup-send-btn:hover {
  background: var(--blue-main-gradient-hover);
  color: #fff;
  transform: scale(1.05);
}

#followup-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin: 0;
}

/* Section Titles */
.section-title {
  font-size: 1.15em;
  font-weight: 600;
  color: var(--blue-main-light);
  margin: 0 0 1em 0;
  letter-spacing: 0.01em;
  padding-bottom: 0.2em;
  border-bottom: 1px solid #23232a;
}

.left-section .section-title {
  color: #fff;
}

.right-section .section-title {
  color: #ffffff; /* Changed from var(--blue-main) to white */
}

/* --- Improved Blue Color Palette --- */
:root {
  --blue-main: #3a7be0;
  --blue-main-dark: #2356a8;
  --blue-main-light: #6eaaff;
  --blue-main-hover: #4d97ff;
  --blue-main-gradient: linear-gradient(135deg, #3a7be0, #2356a8);
  --blue-main-gradient-hover: linear-gradient(135deg, #6eaaff, #3a7be0);
  --blue-font: #b5d6ff;
  --blue-bg-light: #223a5e;
  --blue-bg-chat: #223a5e;
}

/* Settings bar and section titles */
.settings-bar {
  /* ...existing code... */
  background: linear-gradient(to right, #23232a, #23232a 80%, #23232a 100%);
  /* ...existing code... */
}

.section-title {
  /* ...existing code... */
  color: var(--blue-main-light);
  /* ...existing code... */
}
.right-section .section-title {
  color: #ffffff; /* Ensure this is also white, overriding the general .section-title if necessary */
}

/* Chat send button: blue, round, check-circle icon style */
#followup-send-btn {
  background: var(--blue-main-gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 1px 3px rgba(36, 81, 166, 0.15);
  transition: background 0.2s, transform 0.1s;
}

#followup-send-btn:hover {
  background: var(--blue-main-gradient-hover);
  color: #fff;
  transform: scale(1.05);
}

#followup-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin: 0;
}

/* Chat input row background (slightly blue-tinted) */
.chat-input-row {
  /* ...existing code... */
  background-color: var(--blue-bg-light); /* Slightly adjusted input row background */
  /* ...existing code... */
}

/* Assistant chat bubble (slightly blue-tinted) */
.chat-message.assistant .chat-bubble {
  background: none !important; /* Remove background for all assistant messages */
  color: var(--blue-font);
  border-bottom-left-radius: 0;
  box-shadow: none;
  padding-left: 0;
  max-width: 95%; /* Allow more width for assistant messages */
}

/* User chat bubble (darker blue) */
.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, var(--blue-main), var(--blue-main-dark));
  color: #e3f2fd; /* Light blue text */
  border-bottom-right-radius: 4px; /* Tail on the right */
}

/* Keep plan answer distinct with green styling, but in text only - REMOVE COLOR OVERRIDE */
.chat-message.assistant.plan-answer .chat-bubble {
  background: none !important; /* Ensure no background */
  border-bottom-left-radius: 0;
  box-shadow: none;
  padding-left: 0;
}

/* Remove background from the parent message div as well */
.chat-message.assistant.plan-answer {
  background: none !important; /* Ensure no background */
  /* color is inherited or set on the bubble */
}

/* Markdown elements in assistant messages - adjust strong color if needed */
.chat-message.assistant .chat-bubble p { margin: 0 0 0.8em 0; line-height: 1.5; }
.chat-message.assistant .chat-bubble p:last-child { margin-bottom: 0; }
.chat-message.assistant .chat-bubble ul, 
.chat-message.assistant .chat-bubble ol { margin: 0.8em 0 0.8em 1.5em; padding-left: 0.5em; }
.chat-message.assistant .chat-bubble li { margin-bottom: 0.4em; line-height: 1.5; }
.chat-message.assistant .chat-bubble strong { font-weight: 500; color: #ffffff; }

/* Tables need borders even without bubble background */
.chat-message.assistant .chat-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
  background-color: rgba(30, 30, 35, 0.3); /* Very subtle background for tables */
}

.chat-message.assistant .chat-bubble th {
  background-color: #444;
  color: #f0f0f0;
  font-weight: 600;
  border: 1px solid #555;
  padding: 0.7em 0.8em;
}

.chat-message.assistant .chat-bubble td {
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #555;
  padding: 0.7em 0.8em;
}

/* Markdown elements in dark theme */
.chat-bubble p { margin: 0 0 0.8em 0; line-height: 1.5; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble ul, .chat-bubble ol { margin: 0.8em 0 0.8em 1.5em; padding-left: 0.5em; }
.chat-bubble li { margin-bottom: 0.4em; line-height: 1.5; }
.chat-bubble strong { font-weight: 500; color: #ffffff; } /* Brighter bold */
.chat-bubble code {
  background-color: #444; /* Darker code background */
  color: #c5c8c6; /* Light code text */
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.9em;
}
.chat-bubble pre {
  background-color: #2a2a2a; /* Dark pre background */
  color: #c5c8c6; /* Light pre text */
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9em;
  border: 1px solid #444;
}
.chat-bubble pre code {
  background-color: transparent;
  padding: 0;
  border: none;
}
.chat-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
}
.chat-bubble th, .chat-bubble td {
  border: 1px solid #555;
  padding: 0.7em 0.8em;
  text-align: left;
  font-size: 0.93em;
  line-height: 1.4;
}
.chat-bubble th {
  background-color: #444;
  color: #f0f0f0;
  font-weight: 600;
}
.chat-bubble td {
  background-color: #333;
  color: #e0e0e0;
}
.chat-bubble h1, .chat-bubble h2, .chat-bubble h3, 
.chat-bubble h4, .chat-bubble h5, .chat-bubble h6 {
  margin: 1.2em 0 0.7em 0;
  line-height: 1.3;
}
.chat-bubble h1:first-child, .chat-bubble h2:first-child, 
.chat-bubble h3:first-child, .chat-bubble h4:first-child {
  margin-top: 0.4em;
}

.chat-input-row {
  display: flex;
  gap: 0.8em;
  align-items: center;
  padding: 0.6em; /* Slightly more padding */
  border: none; /* Remove border */
  border-radius: 28px; /* More rounded pill shape */
  background-color: var(--blue-bg-light); /* Slightly adjusted input row background */
  box-shadow: 0 3px 8px rgba(0,0,0,0.3); /* Enhanced shadow */
  flex-shrink: 0; /* Prevent input row from shrinking */
}

.chat-input { /* Input field within the row */
  flex: 1 1 auto;
  padding: 0.8em 1em;
  border-radius: 0;
  border: none;
  background-color: transparent;
  font-size: 1em;
  margin: 0;
  outline: none;
  color: #e8eaed; /* Ensure good contrast */
}

.chat-input::placeholder { /* Style placeholder */
    color: #888;
}

.chat-send-btn {
  background: linear-gradient(135deg, #6a95ff, #6289ff); /* Gradient for send button */
  color: #121212; /* Dark icon for contrast */
  border: none;
  border-radius: 50%;
  padding: 0;
  width: 44px; /* Slightly larger */
  height: 44px; /* Slightly larger */
  font-size: 1em;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, #7ca5ff, #7095ff); /* Brighter gradient on hover */
  transform: scale(1.05); /* Slight scale effect */
}

.chat-send-btn:disabled {
  background: #444; /* Dark grey disabled */
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chat-send-btn svg {
  fill: #1e1e1e; /* Dark icon */
  width: 22px; /* Adjust icon size */
  height: 22px;
}

.chat-send-btn:disabled svg {
  fill: #888; /* Dimmer icon when disabled */
}

/* Remove specific styles for buttons now in sidebar */
/* .reset-btn { ... } */
/* .instructions-btn { ... } */
/* .files-btn { ... } */

/* Modal Styles */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
  padding-top: 60px; /* Location of the box */
}

.modal-content {
  background-color: #2e2e30; /* Slightly adjusted modal background */
  color: #e0e0e0;
  margin: 5% auto; /* 5% from the top and centered */
  padding: 25px;
  border: 1px solid #5a5a5a; /* Slightly lighter border */
  border-radius: 12px;
  width: 80%; /* Could be more or less, depending on screen size */
  max-width: 600px; /* Maximum width */
  position: relative;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5); /* Enhanced modal shadow */
  display: flex; /* Use flexbox for layout */
  flex-direction: column; /* Stack content vertically */
}

.modal-content.large { /* Style for wider modals */
    max-width: 800px;
    width: 90%;
}

.modal-close {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
  color: #fff;
  text-decoration: none;
}

.modal h2 {
  margin-top: 0;
  color: #ffffff;
  border-bottom: 1px solid #444;
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

.modal p {
  color: #b0b0b0;
  font-size: 0.95em;
  margin-bottom: 1em;
}

.modal textarea { /* Style textarea within modal */
  width: 100%;
  padding: 0.8em 1em;
  margin-bottom: 1.5em;
  border-radius: 8px;
  border: 1px solid #444;
  background-color: #1e1e1e; /* Slightly darker than modal bg */
  color: #e0e0e0;
  font-size: 0.95em;
  min-height: 150px;
  box-sizing: border-box;
}

.modal textarea:focus {
  border-color: #6289ff;
  box-shadow: 0 0 0 2px rgba(98, 137, 255, 0.3);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1em;
  margin-top: 1em;
}

.modal-save-btn {
  background-color: var(--blue-main); /* Blue save button */
  color: #121212;
  border-color: var(--blue-main-dark);
}

.modal-save-btn:hover {
  background-color: var(--blue-main-hover);
  border-color: var(--blue-main-light);
}

.modal-cancel-btn {
  background-color: #444; /* Grey cancel button */
  color: #e0e0e0;
  border-color: #555;
}

.modal-cancel-btn:hover {
  background-color: #555;
  border-color: #666;
}

.modal-status {
    margin-top: 1em;
    font-size: 0.9em;
    min-height: 1.2em; /* Reserve space */
    text-align: right;
    color: #8ab4f8; /* Default status color */
}

.modal-status.error {
    color: #ff8a80; /* Error status color */
}

/* Files Modal Specific Styles */
.file-list-container {
    margin-bottom: 1.5em;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1em;
    background-color: #1e1e1e; /* Slightly darker background for list area */
    max-height: 300px; /* Limit height and make scrollable */
    overflow-y: auto;
}

.file-list-container h3 {
    margin-top: 0;
    margin-bottom: 0.8em;
    color: #e0e0e0;
    font-size: 1.1em;
}

#file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6em 0.8em;
    border-bottom: 1px solid #333;
    font-size: 0.95em;
}

#file-list li:last-child {
    border-bottom: none;
}

#file-list span { /* Filename */
    flex-grow: 1;
    margin-right: 1em;
    word-break: break-all; /* Prevent long filenames from overflowing */
}

#file-list .file-actions button {
    margin-left: 0.5em;
    padding: 0.3em 0.8em;
    font-size: 0.85em;
}

.file-actions .view-edit-btn {
    background-color: #4a4a4a;
    color: #e0e0e0;
    border-color: #555;
}
.file-actions .view-edit-btn:hover {
    background-color: #5a5a5a;
}

.file-actions .delete-btn {
    background-color: #7d3c3c; /* Dark red */
    color: #f0d0d0;
    border-color: #8d4c4c;
}
.file-actions .delete-btn:hover {
    background-color: #9d4c4c;
}

.upload-section {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #333;
}

.upload-section h3 {
    margin-top: 0;
    margin-bottom: 0.8em;
    color: #e0e0e0;
    font-size: 1.1em;
}

#file-upload-input {
    display: block;
    margin-bottom: 1em;
    color: #b0b0b0; /* Style file input text */
}

/* Style file input button */
#file-upload-input::file-selector-button {
    font-family: inherit;
    padding: 0.5em 1em;
    border-radius: 8px;
    border: 1px solid #444;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    background: #303134;
    color: #bdc1c6;
    margin-right: 1em;
}

#file-upload-input::file-selector-button:hover {
    background: #3c4043;
    border-color: #555;
}

.modal-action-btn { /* General style for action buttons like Upload */
    background-color: var(--blue-main);
    color: #121212;
    border-color: var(--blue-main-dark);
}
.modal-action-btn:hover {
    background-color: var(--blue-main-hover);
    border-color: var(--blue-main-light);
}

/* File Editor Modal Styles */
#file-editor-title {
    margin-top: 0;
    color: #ffffff;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5em;
    margin-bottom: 1em;
}

#file-editor-textarea {
    width: 100%;
    padding: 0.8em 1em;
    margin-bottom: 1.5em;
    border-radius: 8px;
    border: 1px solid #444;
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-size: 0.95em;
    min-height: 300px; /* Taller editor */
    box-sizing: border-box;
    font-family: monospace; /* Use monospace for editing */
}

#file-editor-textarea:focus {
    border-color: #6289ff;
    box-shadow: 0 0 0 2px rgba(98, 137, 255, 0.3);
}

/* Ensure button base styles are defined if needed elsewhere */
button {
  /* Basic button reset if needed */
  font-family: inherit;
}


/* New styles for age selection */
.age-group label {
  margin-bottom: 0.5em; /* Consistent spacing */
}

.age-selects {
  display: flex;
  gap: 0.8em; /* Space between year and month dropdowns */
}

.age-selects select {
  flex: 1; /* Make dropdowns share space */
  min-width: 80px; /* Ensure dropdowns don't get too small */
}

/* Adjust padding for select with arrow */
select {
  /* ... existing select styles ... */
  padding: 0.9em 3em 0.9em 1.1em; /* Ensure right padding accommodates arrow */
}

/* New styles for vaccine selection */
.vaccine-group { /* Adjust vaccine group layout */
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.vaccine-group label {
  margin-bottom: 0.3em;
}

#previous-vaccines-list {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  margin-bottom: 0; /* Ensure space between list and button */
}

.vaccine-entry {
  display: flex;
  gap: 0.5em;
  align-items: center; /* Vertically center items in the row */
  padding: 0.2em 0.1em;
  font-size: 0.97em;
}

.vaccine-entry select {
  flex: 1; /* Allow dropdowns to grow */
  height: 3.5em; /* Ensure consistent height */
}

.vaccine-entry .vaccine-select {
  min-width: 200px; /* Give more space to vaccine name */
}

.vaccine-entry .dose-select {
  min-width: 80px;
}

.remove-vaccine-btn {
  background-color: #7d3c3c3c; /* Dark red */
  color: #f0d0d0;
  border-color: #8d4c4c;
  padding: 0.4em 0.8em; /* Slightly smaller padding */
  font-size: 0.85em;
  flex-shrink: 0; /* Prevent button from shrinking */
}
.remove-vaccine-btn:hover {
    background-color: #9d4c4c;
}

.add-btn { /* Style for Add Vaccine button (now opens modal) */
  /* Match select styles */
  background-color: #2a2a2a; /* Match select background */
  color: #e0e0e0; /* Match select text color */
  border: 1px solid #444; /* Match select border */
  border-radius: 10px; /* Match select border-radius */
  padding: 0 0.9em; /* Match horizontal padding of select */
  font-size: 0.97em; /* Match select font-size */
  cursor: pointer;
  font-weight: 500; /* Keep button font-weight */
  transition: background-color 0.2s ease, border-color 0.2s ease;
  display: inline-block; /* Make it fit content width */
  height: 2.6em; /* Match height of selects */
  line-height: 2.6em; /* Vertically center text using line-height */
  text-align: center; /* Center text horizontally */
  margin-top: 0; /* Keep or adjust as needed */
  /* Remove align-self: flex-start; */
  white-space: nowrap; /* Prevent text wrapping */
}

.add-btn:hover {
  background: #3c4043; /* Slightly lighter grey on hover */
  border-color: #555; /* Slightly lighter border on hover */
  color: #ffffff; /* Slightly brighter text on hover */
}

/* Add Vaccine Modal Styles */
#add-vaccine-modal .modal-content {
    max-width: 500px; /* Adjust width as needed */
}

.add-vaccine-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
    margin-bottom: 1.5em;
}

.add-vaccine-form .form-group {
    flex: 1;
    min-width: 0; /* Override previous min-width if needed */
}

/* New styles for medical conditions container */
#medical-conditions-container {
  max-height: 100px; /* Adjust as needed */
  overflow-y: auto;
  padding: 0.8em;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #2a2a2a; /* Match other input backgrounds */
  margin-top: 0.3em; /* Align with other inputs */
  display: block; /* Changed from flex to block for proper vertical stacking */
}

#medical-conditions-container label {
  display: flex; /* I want the to be inline */
  justify-content: space-between; /* Space between checkbox and label */
  width: 100%; /* Full width for label */
  padding: 0.5em 0.8em; /* Padding for each item */
  align-items: center;
  margin-bottom: 0.6em; /* Space between items */
  font-size: 0.95em;
  color: #e0e0e0; /* Light text */
  cursor: pointer;
}

#medical-conditions-container input[type="checkbox"] {
  margin-right: 0.7em;
  /* Optional: Style checkbox appearance if desired, though browser defaults are often fine */
  width: 16px;
  height: 16px;
  accent-color: var(--blue-main); /* Color the checkbox when checked */
}


/* New compact vaccine selection panel styles */
.vaccine-selection-panel {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5em;
  border: 1px solid #444;
  border-radius: 10px;
  background-color: #2a2a2a;
}

.vaccine-selection-panel .vaccine-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7em;
  padding: 0.3em 0.5em;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.vaccine-selection-panel .vaccine-item:last-child {
  margin-bottom: 0;
}

.vaccine-selection-panel .vaccine-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1em;
}

.vaccine-selection-panel .dose-select {
  width: auto;
  min-width: 100px;
  max-width: 120px;
  height: 2.5em;
  padding: 0.3em 2em 0.3em 0.8em;
  margin-left: 0.5em;
  flex: 0 0 auto;
}

/* Add visual indication for items where a dose is selected */
.vaccine-selection-panel .vaccine-item.selected {
  background-color: rgba(58, 123, 224, 0.15);
  border: 1px solid rgba(58, 123, 224, 0.3);
}

.vaccine-selection-panel .all-up-to-date-option {
  border-bottom: 1px solid #444;
  margin-bottom: 1em;
  padding-bottom: 0.7em;
}

.vaccine-selection-panel .all-up-to-date-option label {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  cursor: pointer;
}

.add-vaccine-form select {
    /* Styles already defined, ensure height is consistent */
    height: 3.5em;
}

/* Media query adjustments if needed */
/* Consider hiding/collapsing sidebar on smaller screens */
@media (max-width: 768px) {
  .app-wrapper {
    flex-direction: column; /* Stack sidebar and content */
  }
  .sidebar {
    width: 100%; /* Full width */
    height: auto; /* Auto height */
    border-right: none;
    border-bottom: 1px solid #333;
    flex-direction: row; /* Arrange items horizontally */
    flex-wrap: wrap; /* Allow wrapping */
    justify-content: center; /* Center buttons */
    padding: 0.8em;
  }
  .sidebar h2 {
      display: none; /* Hide title on small screens */
  }
  .sidebar-btn {
      width: auto; /* Auto width for buttons */
      flex-grow: 1; /* Allow buttons to grow */
      text-align: center; /* Center text */
      min-width: 120px; /* Minimum width */
  }
  .chat-container {
      height: auto; /* Adjust height */
      min-height: 60vh;
      padding: 0.7em 0.5em 0.7em 0.5em;
      flex-grow: 1; /* Take remaining space */
  }
}

/* ... other existing media queries ... */
@media (min-width: 600px) {
/* ... existing media query styles ... */
  /* Remove or comment out flex-grow if it causes issues */
  /* .vaccine-group {
      flex-grow: 2;
  } */
}

/* Thinking Steps Styles */
.thinking-steps {
  background: rgba(30, 30, 35, 0.75);
  border-radius: 12px;
  padding: 1.2em 1.5em;
  margin-bottom: 1.5em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  max-width: 80%;
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.thinking-title {
  display: flex;
  align-items: center;
  color: #8ab4f8;
  font-weight: 500;
  margin-bottom: 1em;
  font-size: 0.95em;
}

.thinking-title svg {
  margin-right: 0.5em;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.thinking-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.thinking-step {
  display: flex;
  align-items: flex-start;
  color: rgba(224, 224, 224, 0.5);
  transition: color 0.3s ease;
}

.thinking-step.active {
  color: #e0e0e0;
}

.thinking-step.completed {
  color: rgba(138, 180, 248, 0.8);
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 1em;
  min-width: 20px;
}

.step-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  margin-bottom: 0.2em;
  transition: background-color 0.3s ease;
}

.thinking-step.active .step-circle {
  background-color: #8ab4f8;
  border-color: #8ab4f8;
  box-shadow: 0 0 0 4px rgba(138, 180, 248, 0.15);
}

.thinking-step.completed .step-circle {
  background-color: #8ab4f8;
  border-color: #8ab4f8;
}

.step-line {
  width: 2px;
  height: 20px;
  background-color: rgba(224, 224, 224, 0.2);
}

.thinking-step:last-child .step-line {
  display: none;
}

.thinking-step.active .step-line,
.thinking-step.completed .step-line {
  background-color: rgba(138, 180, 248, 0.5);
}

.step-content {
  padding: 0.2em 0;
  font-size: 0.9em;
}

/* Modify loading bubble to blend with thinking steps */
.loading-bubble {
  background: rgba(30, 30, 35, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  opacity: 0;
  height: 0;
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
  transition: opacity 0.3s ease;
}

/* Help Modal Styles */
#help-modal .modal-content {
  max-width: 600px;
  width: 90%;
}

#help-modal h2 {
  margin-top: 0;
}

#help-modal ul {
  margin: 0 0 1em 1.5em;
  padding: 0;
  color: #b0b0b0;
  font-size: 0.97em;
}

#help-modal p {
  color: #b0b0b0;
  margin-bottom: 1em;
}

#help-modal strong {
  color: #fff;
}

#help-modal .modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1em;
  margin-top: 1em;
}

/* Main Content Styles */
.main-content {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 54px); /* Subtract top bar height */
  width: 100%;
  position: relative;
}

.left-section {
  flex: 0 0 33.33%;   /* Use 1/3 of the width */
  min-width: 280px;    /* Optional: prevent too small on small screens */
  max-width: 480px;    /* Optional: prevent too wide on large screens */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #202024;
  border-right: none;
  padding: 1.2em 1.5em 1.2em 1.5em;
  justify-content: flex-start;
}

.right-section {
  flex: 1 1 66.66%;    /* Use 2/3 of the width */
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: none;
  padding: 1.2em 1.5em 1.2em 1.5em;
  justify-content: flex-start;
  position: relative;
  color: var(--blue-font);
  box-shadow: -8px 0 24px -16px rgba(58,123,224,0.08);
}



.child-info-form {
  flex-direction: column;
  gap: 1em;
  margin-bottom: 1.5em;
  align-items: stretch;
}

#initial-form {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  flex: 1 1 auto;
}

#initial-send-btn {
  align-self: flex-end;
  margin-top: 1em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: linear-gradient(135deg, #3ecf8e, #2eb872);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px; /* Slightly larger */
  height: 44px; /* Slightly larger */
  font-size: 1em;
  font-weight: 500;
  padding: 0.7em 1.5em;
  box-shadow: 0 1px 3px rgba(46, 184, 114, 0.15);
  transition: background 0.2s, transform 0.1s;
}

#initial-send-btn:hover {
  background: linear-gradient(135deg, #43e697, #38c47c);
  color: #fff;
  transform: translateY(-2px) scale(1.03);
}

#initial-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin-right: 0.3em;
}

/* Remove default button border on focus */
#initial-send-btn:focus {
  outline: none;
  border: none;
}

#initial-query-input {
  height: 2.2em !important;
  min-height: 0 !important;
  padding: 0.5em 1em !important;
  font-size: 1em;
  background-image: none !important; /* Remove dropdown arrow */
  padding-right: 1em !important; /* Remove extra space for arrow */
  box-shadow: none;
}

#initial-query-input {
  margin-top: 0.3em;
}

.right-section .chat-history {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-bottom: 1.2em;
  padding-right: 10px;
  background: transparent;
}

#followup-chat-form {
  display: flex;
  gap: 0.8em;
  align-items: center;
  border-radius: 28px;
  background-color: #2f2f31;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  padding: 0.6em;
  margin-top: 0;
  margin-bottom: 0;
  position: relative;
  width: 50%; /* Reduce width to 50% */
  /* To align left (default), no change. To center: margin-left: auto; margin-right: auto; */
}

#followup-chat-input {
  flex: 1 1 auto;
  padding: 0.8em 1em;
  border-radius: 0;
  border: none;
  background-color: transparent;
  font-size: 1em;
  margin: 0;
  outline: none;
  color: #e8eaed;
  background-image: none !important; /* Remove arrow background image */
  padding-right: 1em !important; /* Reset padding adjusted for arrow */
}

#followup-send-btn {
  background: var(--blue-main-gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 1px 3px rgba(36, 81, 166, 0.15);
  transition: background 0.2s, transform 0.1s;
}

#followup-send-btn:hover {
  background: var(--blue-main-gradient-hover);
  color: #fff;
  transform: scale(1.05);
}

#followup-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin: 0;
}

@media (max-width: 900px) {
  .main-content {
    flex-direction: column;
    height: auto;
  }
  .left-section, .right-section {
    width: 100%;
    min-width: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #333;
    padding: 1em 0.7em;
  }
  .right-section {
    border-bottom: none;
  }
}

/* Improved Get Plan button: dark green, round, icon-only on desktop, full width on mobile */
#initial-send-btn {
  background: linear-gradient(135deg, #217a4b, #1e5e3b);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 1px 3px rgba(33, 122, 75, 0.15);
  transition: background 0.2s, transform 0.1s;
  margin-top: 0.2em;
}

#initial-send-btn:hover {
  background: linear-gradient(135deg, #299e5e, #217a4b);
  color: #fff;
  transform: scale(1.05);
}

#initial-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin: 0;
}

#initial-send-btn span {
  display: none;
  font-size: 0.97em;
}

@media (max-width: 900px) {
  #initial-send-btn {
    border-radius: 8px;
    width: 100%;
    min-width: 0;
    min-height: 38px;
    height: 38px;
    justify-content: center;
    gap: 0.5em;
    padding: 0.5em 0;
  }
  #initial-send-btn span {
    display: inline;
    font-size: 0.97em;
    font-weight: 500;
    margin-left: 0.4em;
  }
}

/* Chat send button: blue, round, check-circle icon style */
#followup-send-btn {
  background: var(--blue-main-gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 1px 3px rgba(36, 81, 166, 0.15);
  transition: background 0.2s, transform 0.1s;
}

#followup-send-btn:hover {
  background: var(--blue-main-gradient-hover);
  color: #fff;
  transform: scale(1.05);
}

#followup-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin: 0;
}

/* Section Titles */
.section-title {
  font-size: 1.15em;
  font-weight: 600;
  color: var(--blue-main-light);
  margin: 0 0 1em 0;
  letter-spacing: 0.01em;
  padding-bottom: 0.2em;
  border-bottom: 1px solid #23232a;
}

.left-section .section-title {
  color: #fff;
}

.right-section .section-title {
  color: #ffffff; /* Changed from var(--blue-main) to white */
}

/* --- Improved Blue Color Palette --- */
:root {
  --blue-main: #3a7be0;
  --blue-main-dark: #2356a8;
  --blue-main-light: #6eaaff;
  --blue-main-hover: #4d97ff;
  --blue-main-gradient: linear-gradient(135deg, #3a7be0, #2356a8);
  --blue-main-gradient-hover: linear-gradient(135deg, #6eaaff, #3a7be0);
  --blue-font: #b5d6ff;
  --blue-bg-light: #223a5e;
  --blue-bg-chat: #223a5e;
}

/* Settings bar and section titles */
.settings-bar {
  /* ...existing code... */
  background: linear-gradient(to right, #23232a, #23232a 80%, #23232a 100%);
  /* ...existing code... */
}

.section-title {
  /* ...existing code... */
  color: var(--blue-main-light);
  /* ...existing code... */
}
.right-section .section-title {
  color: #ffffff; /* Ensure this is also white, overriding the general .section-title if necessary */
}

/* Chat send button: blue, round, check-circle icon style */
#followup-send-btn {
  background: var(--blue-main-gradient);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1em;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 1px 3px rgba(36, 81, 166, 0.15);
  transition: background 0.2s, transform 0.1s;
}

#followup-send-btn:hover {
  background: var(--blue-main-gradient-hover);
  color: #fff;
  transform: scale(1.05);
}

#followup-send-btn svg {
  fill: #fff;
  width: 22px;
  height: 22px;
  margin: 0;
}

/* Chat input row background (slightly blue-tinted) */
.chat-input-row {
  /* ...existing code... */
  background-color: var(--blue-bg-light); /* Slightly adjusted input row background */
  /* ...existing code... */
}

/* Assistant chat bubble (slightly blue-tinted) */
.chat-message.assistant .chat-bubble {
  background: none !important; /* Remove background for all assistant messages */
  color: var(--blue-font);
  border-bottom-left-radius: 0;
  box-shadow: none;
  padding-left: 0;
  max-width: 95%; /* Allow more width for assistant messages */
}

/* User chat bubble (darker blue) */
.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, var(--blue-main), var(--blue-main-dark));
  color: #e3f2fd; /* Light blue text */
  border-bottom-right-radius: 4px; /* Tail on the right */
}

/* Keep plan answer distinct with green styling, but in text only - REMOVE COLOR OVERRIDE */
.chat-message.assistant.plan-answer .chat-bubble {
  background: none !important; /* Ensure no background */
  border-bottom-left-radius: 0;
  box-shadow: none;
  padding-left: 0;
}

/* Remove background from the parent message div as well */
.chat-message.assistant.plan-answer {
  background: none !important; /* Ensure no background */
  /* color is inherited or set on the bubble */
}

/* Markdown elements in assistant messages - adjust strong color if needed */
.chat-message.assistant .chat-bubble p { margin: 0 0 0.8em 0; line-height: 1.5; }
.chat-message.assistant .chat-bubble p:last-child { margin-bottom: 0; }
.chat-message.assistant .chat-bubble ul, 
.chat-message.assistant .chat-bubble ol { margin: 0.8em 0 0.8em 1.5em; padding-left: 0.5em; }
.chat-message.assistant .chat-bubble li { margin-bottom: 0.4em; line-height: 1.5; }
.chat-message.assistant .chat-bubble strong { font-weight: 500; color: #ffffff; }

/* Tables need borders even without bubble background */
.chat-message.assistant .chat-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
  background-color: rgba(30, 30, 35, 0.3); /* Very subtle background for tables */
}

.chat-message.assistant .chat-bubble th {
  background-color: #444;
  color: #f0f0f0;
  font-weight: 600;
  border: 1px solid #555;
  padding: 0.7em 0.8em;
}

.chat-message.assistant .chat-bubble td {
  background-color: #333;
  color: #e0e0e0;
  border: 1px solid #555;
  padding: 0.7em 0.8em;
}

/* Markdown elements in dark theme */
.chat-bubble p { margin: 0 0 0.8em 0; line-height: 1.5; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble ul, .chat-bubble ol { margin: 0.8em 0 0.8em 1.5em; padding-left: 0.5em; }
.chat-bubble li { margin-bottom: 0.4em; line-height: 1.5; }
.chat-bubble strong { font-weight: 500; color: #ffffff; } /* Brighter bold */
.chat-bubble code {
  background-color: #444; /* Darker code background */
  color: #c5c8c6; /* Light code text */
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.9em;
}
.chat-bubble pre {
  background-color: #2a2a2a; /* Dark pre background */
  color: #c5c8c6; /* Light pre text */
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9em;
  border: 1px solid #444;
}
.chat-bubble pre code {
  background-color: transparent;
  padding: 0;
  border: none;
}
.chat-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
}
.chat-bubble th, .chat-bubble td {
  border: 1px solid #555;
  padding: 0.7em 0.8em;
  text-align: left;
  font-size: 0.93em;
  line-height: 1.4;
}
.chat-bubble th {
  background-color: #444;
  color: #f0f0f0;
  font-weight: 600;
}
.chat-bubble td {
  background-color: #333;
  color: #e0e0e0;
}
.chat-bubble h1, .chat-bubble h2, .chat-bubble h3, 
.chat-bubble h4, .chat-bubble h5, .chat-bubble h6 {
  margin: 1.2em 0 0.7em 0;
  line-height: 1.3;
}
.chat-bubble h1:first-child, .chat-bubble h2:first-child, 
.chat-bubble h3:first-child, .chat-bubble h4:first-child {
  margin-top: 0.4em;
}

.chat-input-row {
  display: flex;
  gap: 0.8em;
  align-items: center;
  padding: 0.6em; /* Slightly more padding */
  border: none; /* Remove border */
  border-radius: 28px; /* More rounded pill shape */
  background-color: var(--blue-bg-light); /* Slightly adjusted input row background */
  box-shadow: 0 3px 8px rgba(0,0,0,0.3); /* Enhanced shadow */
  flex-shrink: 0; /* Prevent input row from shrinking */
}

.chat-input { /* Input field within the row */
  flex: 1 1 auto;
  padding: 0.8em 1em;
  border-radius: 0;
  border: none;
  background-color: transparent;
  font-size: 1em;
  margin: 0;
  outline: none;
  color: #e8eaed; /* Ensure good contrast */
}

.chat-input::placeholder { /* Style placeholder */
    color: #888;
}

.chat-send-btn {
  background: linear-gradient(135deg, #6a95ff, #6289ff); /* Gradient for send button */
  color: #121212; /* Dark icon for contrast */
  border: none;
  border-radius: 50%;
  padding: 0;
  width: 44px; /* Slightly larger */
  height: 44px; /* Slightly larger */
  font-size: 1em;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, #7ca5ff, #7095ff); /* Brighter gradient on hover */
  transform: scale(1.05); /* Slight scale effect */
}

.chat-send-btn:disabled {
  background: #444; /* Dark grey disabled */
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chat-send-btn svg {
  fill: #1e1e1e; /* Dark icon */
  width: 22px; /* Adjust icon size */
  height: 22px;
}

.chat-send-btn:disabled svg {
  fill: #888; /* Dimmer icon when disabled */
}

/* Remove specific styles for buttons now in sidebar */
/* .reset-btn { ... } */
/* .instructions-btn { ... } */
/* .files-btn { ... } */

/* Modal Styles */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
  padding-top: 60px; /* Location of the box */
}

.modal-content {
  background-color: #2e2e30; /* Slightly adjusted modal background */
  color: #e0e0e0;
  margin: 5% auto; /* 5% from the top and centered */
  padding: 25px;
  border: 1px solid #5a5a5a; /* Slightly lighter border */
  border-radius: 12px;
  width: 80%; /* Could be more or less, depending on screen size */
  max-width: 600px; /* Maximum width */
  position: relative;
  box-shadow: 0 8px 25px rgba(0,0,0,0.5); /* Enhanced modal shadow */
  display: flex; /* Use flexbox for layout */
  flex-direction: column; /* Stack content vertically */
}

.modal-content.large { /* Style for wider modals */
    max-width: 800px;
    width: 90%;
}

.modal-close {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
  color: #fff;
  text-decoration: none;
}

.modal h2 {
  margin-top: 0;
  color: #ffffff;
  border-bottom: 1px solid #444;
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

.modal p {
  color: #b0b0b0;
  font-size: 0.95em;
  margin-bottom: 1em;
}

.modal textarea { /* Style textarea within modal */
  width: 100%;
  padding: 0.8em 1em;
  margin-bottom: 1.5em;
  border-radius: 8px;
  border: 1px solid #444;
  background-color: #1e1e1e; /* Slightly darker than modal bg */
  color: #e0e0e0;
  font-size: 0.95em;
  min-height: 150px;
  box-sizing: border-box;
}

.modal textarea:focus {
  border-color: #6289ff;
  box-shadow: 0 0 0 2px rgba(98, 137, 255, 0.3);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1em;
  margin-top: 1em;
}

.modal-save-btn {
  background-color: var(--blue-main); /* Blue save button */
  color: #121212;
  border-color: var(--blue-main-dark);
}

.modal-save-btn:hover {
  background-color: var(--blue-main-hover);
  border-color: var(--blue-main-light);
}

.modal-cancel-btn {
  background-color: #444; /* Grey cancel button */
  color: #e0e0e0;
  border-color: #555;
}

.modal-cancel-btn:hover {
  background-color: #555;
  border-color: #666;
}

.modal-status {
    margin-top: 1em;
    font-size: 0.9em;
    min-height: 1.2em; /* Reserve space */
    text-align: right;
    color: #8ab4f8; /* Default status color */
}

.modal-status.error {
    color: #ff8a80; /* Error status color */
}

/* Files Modal Specific Styles */
.file-list-container {
    margin-bottom: 1.5em;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1em;
    background-color: #1e1e1e; /* Slightly darker background for list area */
    max-height: 300px; /* Limit height and make scrollable */
    overflow-y: auto;
}

.file-list-container h3 {
    margin-top: 0;
    margin-bottom: 0.8em;
    color: #e0e0e0;
    font-size: 1.1em;
}

#file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6em 0.8em;
    border-bottom: 1px solid #333;
    font-size: 0.95em;
}

#file-list li:last-child {
    border-bottom: none;
}

#file-list span { /* Filename */
    flex-grow: 1;
    margin-right: 1em;
    word-break: break-all; /* Prevent long filenames from overflowing */
}

#file-list .file-actions button {
    margin-left: 0.5em;
    padding: 0.3em 0.8em;
    font-size: 0.85em;
}

.file-actions .view-edit-btn {
    background-color: #4a4a4a;
    color: #e0e0e0;
    border-color: #555;
}
.file-actions .view-edit-btn:hover {
    background-color: #5a5a5a;
}

.file-actions .delete-btn {
    background-color: #7d3c3c; /* Dark red */
    color: #f0d0d0;
    border-color: #8d4c4c;
}
.file-actions .delete-btn:hover {
    background-color: #9d4c4c;
}

.upload-section {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #333;
}

.upload-section h3 {
    margin-top: 0;
    margin-bottom: 0.8em;
    color: #e0e0e0;
    font-size: 1.1em;
}

#file-upload-input {
    display: block;
    margin-bottom: 1em;
    color: #b0b0b0; /* Style file input text */
}

/* Style file input button */
#file-upload-input::file-selector-button {
    font-family: inherit;
    padding: 0.5em 1em;
    border-radius: 8px;
    border: 1px solid #444;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    background: #303134;
    color: #bdc1c6;
    margin-right: 1em;
}

#file-upload-input::file-selector-button:hover {
    background: #3c4043;
    border-color: #555;
}

.modal-action-btn { /* General style for action buttons like Upload */
    background-color: var(--blue-main);
    color: #121212;
    border-color: var(--blue-main-dark);
}
.modal-action-btn:hover {
    background-color: var(--blue-main-hover);
    border-color: var(--blue-main-light);
}

/* File Editor Modal Styles */
#file-editor-title {
    margin-top: 0;
    color: #ffffff;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5em;
    margin-bottom: 1em;
}

#file-editor-textarea {
    width: 100%;
    padding: 0.8em 1em;
    margin-bottom: 1.5em;
    border-radius: 8px;
    border: 1px solid #444;
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-size: 0.95em;
    min-height: 300px; /* Taller editor */
    box-sizing: border-box;
    font-family: monospace; /* Use monospace for editing */
}

#file-editor-textarea:focus {
    border-color: #6289ff;
    box-shadow: 0 0 0 2px rgba(98, 137, 255, 0.3);
}

/* Ensure button base styles are defined if needed elsewhere */
button {
  /* Basic button reset if needed */
  font-family: inherit;
}


/* New styles for age selection */
.age-group label {
  margin-bottom: 0.5em; /* Consistent spacing */
}

.age-selects {
  display: flex;
  gap: 0.8em; /* Space between year and month dropdowns */
}

.age-selects select {
  flex: 1; /* Make dropdowns share space */
  min-width: 80px; /* Ensure dropdowns don't get too small */
}

/* Adjust padding for select with arrow */
select {
  /* ... existing select styles ... */
  padding: 0.9em 3em 0.9em 1.1em; /* Ensure right padding accommodates arrow */
}

/* New styles for vaccine selection */
.vaccine-group { /* Adjust vaccine group layout */
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.vaccine-group label {
  margin-bottom: 0.3em;
}

#previous-vaccines-list {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  margin-bottom: 0; /* Ensure space between list and button */
}

.vaccine-entry {
  display: flex;
  gap: 0.5em;
  align-items: center; /* Vertically center items in the row */
  padding: 0.2em 0.1em;
  font-size: 0.97em;
}

.vaccine-entry select {
  flex: 1; /* Allow dropdowns to grow */
  height: 3.5em; /* Ensure consistent height */
}

.vaccine-entry .vaccine-select {
  min-width: 200px; /* Give more space to vaccine name */
}

.vaccine-entry .dose-select {
  min-width: 80px;
}

.remove-vaccine-btn {
  background-color: #7d3c3c; /* Dark red */
  color: #f0d0d0;
  border-color: #8d4c4c;
  padding: 0.4em 0.8em; /* Slightly smaller padding */
  font-size: 0.85em;
  flex-shrink: 0; /* Prevent button from shrinking */
}
.remove-vaccine-btn:hover {
    background-color: #9d4c4c;
}

.add-btn { /* Style for Add Vaccine button (now opens modal) */
  /* Match select styles */
  background-color: #2a2a2a; /* Match select background */
  color: #e0e0e0; /* Match select text color */
  border: 1px solid #444; /* Match select border */
  border-radius: 10px; /* Match select border-radius */
  padding: 0 0.9em; /* Match horizontal padding of select */
  font-size: 0.97em; /* Match select font-size */
  cursor: pointer;
  font-weight: 500; /* Keep button font-weight */
  transition: background-color 0.2s ease, border-color 0.2s ease;
  display: inline-block; /* Make it fit content width */
  height: 2.6em; /* Match height of selects */
  line-height: 2.6em; /* Vertically center text using line-height */
  text-align: center; /* Center text horizontally */
  margin-top: 0; /* Keep or adjust as needed */
  /* Remove align-self: flex-start; */
  white-space: nowrap; /* Prevent text wrapping */
}

.add-btn:hover {
  background: #3c4043; /* Slightly lighter grey on hover */
  border-color: #555; /* Slightly lighter border on hover */
  color: #ffffff; /* Slightly brighter text on hover */
}

/* Add Vaccine Modal Styles */
#add-vaccine-modal .modal-content {
    max-width: 500px; /* Adjust width as needed */
}

.add-vaccine-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
    margin-bottom: 1.5em;
}

.add-vaccine-form .form-group {
    flex: 1;
    min-width: 0; /* Override previous min-width if needed */
}

/* New styles for medical conditions container */
#medical-conditions-container {
  max-height: 100px; /* Adjust as needed */
  overflow-y: auto;
  padding: 0.8em;
  border: 1px solid #444;
  border-radius: 8px;
  background-color: #2a2a2a; /* Match other input backgrounds */
  margin-top: 0.3em; /* Align with other inputs */
  display: block; /* Changed from flex to block for proper vertical stacking */
}

#medical-conditions-container label {
  display: flex; /* I want the to be inline */
  justify-content: space-between; /* Space between checkbox and label */
  width: 100%; /* Full width for label */
  padding: 0.5em 0.8em; /* Padding for each item */
  align-items: center;
  margin-bottom: 0.6em; /* Space between items */
  font-size: 0.95em;
  color: #e0e0e0; /* Light text */
  cursor: pointer;
}

#medical-conditions-container input[type="checkbox"] {
  margin-right: 0.7em;
  /* Optional: Style checkbox appearance if desired, though browser defaults are often fine */
  width: 16px;
  height: 16px;
  accent-color: var(--blue-main); /* Color the checkbox when checked */
}
