/* Quick-replies container and buttons */
.quick-replies { flex-wrap: wrap; }
.quick-replies .button { height: auto; padding: 8px 12px; line-height: 1.2; }
.quick-replies .button-ghost { font-size: 13px; }

@media (max-width: 480px) {
  .quick-replies { gap: 6px !important; }
  .quick-replies .button-ghost { font-size: 12px; padding: 8px 10px; }
}
/* Base resets useful for layout */
html, body {
  overflow-x: hidden;
  padding: 0;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
    Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
  position: relative;
}

/* Ensure sequential stacking no matter previous alignment */
.message_income,
.message_outcome,
.message_income_general {
  clear: both;
}

* { box-sizing: border-box; }

/* Chat UI styles (ported from previous globals.css) */
.root_css_chat {
  width: 100%;
  padding: 0 15px 10px;
  overflow: hidden;
  position: relative;
}

.message_income {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px;
  position: static;
  left: 0px;
  top: 0px;
  background: rgba(86, 84, 168, 0.12);
  border-radius: 20px 20px 20px 0px;
  max-width: 60%;
  line-height: 1.6;
  margin: 15px 6px; /* add slight side spacing so bubbles never touch screen edge */
}

.message_income_general {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px;
  position: static;
  left: 0px;
  top: 0px;
  background: rgba(86, 84, 168, 0.12);
  border-radius: 20px 20px 20px 20px;
  max-width: 60%;
  line-height: 1.6;
  margin: 15px 6px;
}

.message_income_general:last-child {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 16px;
  position: static;
  left: 0px;
  top: 0px;
  background: rgba(86, 84, 168, 0.12);
  border-radius: 20px 20px 20px 0;
  max-width: 60%;
  line-height: 1.6;
  margin: 15px 6px;
}

.message_outcome_box { width: 100% !important; }

.message_outcome {
  padding: 16px;
  background: rgba(0, 110, 28, 0.12);
  border-radius: 20px 20px 0px 20px;
  line-height: 1.6;
  max-width: 60%;
  color: #00210B !important;
  margin: 15px 6px 30px auto; /* consistent side spacing and align right */
  display: block;
}

.scroll-to-bottom-style { width: 100%; }
.scroll-to-bottom-style::-webkit-scrollbar { width: 100%; display: none; }

.invisible-scrollbar::-webkit-scrollbar { width: 5px; height: 8px; }
.invisible-scrollbar { scroll-behavior: smooth; }

.hide_class { display: none; }

.custom-scrollbar::-webkit-scrollbar { width: 12px; }
.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border: 4px solid #fcfdf6;
  border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #1B5E20;
  border: 2px solid #fcfdf6;
  border-radius: 10px;
}

@media screen and (max-width: 666px){
  /* Preserve some horizontal padding on small screens so bubbles don't touch edges */
  .root_css_chat { padding: 0 12px 10px; }
}

/* Rich text content styling for chat bubbles */
.text-editor {
  color: rgba(19, 26, 42, 0.8);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
.text-editor h1,
.text-editor h2,
.text-editor h3,
.text-editor h4,
.text-editor h5,
.text-editor h6 { color: #000; margin: 6px 0; }
.text-editor h1 { font-size: 36px; line-height: 40px; }
.text-editor h2 { font-size: 32px; line-height: 36px; }
.text-editor h3 { font-size: 28px; line-height: 32px; }
.text-editor h4 { font-size: 24px; line-height: 28px; }
.text-editor h5 { font-size: 20px; line-height: 24px; }
.text-editor h6 { font-size: 16px; line-height: 20px; }
.text-editor p { font-size: 16px; line-height: 22px; margin: 10px 0; }
.text-editor strong,
.text-editor b { color: #000; }
.text-editor a { color: rgb(0, 110, 28); text-decoration: underline; }
.text-editor a:hover { text-decoration: none; }
.text-editor ul,
.text-editor ol {
  margin: 8px 0 12px;
  padding-left: 1.25rem;
}
.text-editor li {
  font-size: 16px;
  line-height: 20px;
  color: rgba(19, 26, 42, 0.75);
}
.text-editor li + li { margin-top: 4px; }
.text-editor img { max-width: 100%; height: auto; }

/* Send button styling */
.button {
  text-decoration: none;
  border: none;
  display: inline-flex;
  cursor: pointer;
  font-size: 14px;
  border-radius: 16px;
  text-transform: uppercase;
  height: 40px;
  padding: 0 18px;
  outline: none;
  align-items: center;
  background: #ccff90;
  color: #00210b;
}

.button-ghost {
  background: transparent;
  color: #1b5e20;
  border: 1px solid #1b5e20;
  /* allow multi-line labels without clipping */
  height: auto;
  padding: 8px 12px;
  border-radius: 14px;
}

/* Hover/focus and selected states for quick replies */
.button-ghost:hover,
.button-ghost:focus-visible {
  background: rgba(27, 94, 32, 0.08);
  outline: none;
}
.button-ghost.selected {
  background: #1B5E20;
  color: #ccff90;
  border-color: #1B5E20;
}
.button:disabled,
.button-ghost:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Typing indicator (Signal-like) */
.typing-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 16px;
  padding: 6px 10px;
  background: rgba(86, 84, 168, 0.12);
  border-radius: 12px;
}

.typing-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5654a8;
  opacity: 0.5;
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-dots .dot:nth-child(1) { animation-delay: 0s; }
.typing-dots .dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dots .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-4px); opacity: 1; }
}
