/* ========================================
   BETTY WIDGET STYLING
   Loads on every page via base.html.
   Overrides default <betty-bot> styles + welcome state.
   ======================================== */
/*v2*/
.betty-widget-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== Welcome state ===== */
.betty-welcome {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.betty-welcome.hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  position: absolute;
}
.betty-welcome__label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}
.betty-welcome__prompts {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.betty-welcome__prompts button {
  display: block;
  text-align: left;
  width: 100%;
  background: var(--off-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.betty-welcome__prompts button:hover {
  background: var(--light-plum);
  border-color: var(--plum);
  color: var(--plum);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ===== Widget element ===== */
betty-bot {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
betty-bot > div {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}
betty-bot .bettyContainer {
  flex: 1 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  font-family: var(--font-body) !important;
}
betty-bot #side-menu-and-betty,
betty-bot #betty-wrapper {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}
betty-bot #header-wrapper { display: none !important; }
betty-bot #chat-wrapper {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: var(--space-6) 0 !important;
  background: transparent !important;
}
betty-bot #chat-content {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
betty-bot #bottom-wrapper {
  flex-shrink: 0 !important;
  padding: 0 0 var(--space-6) !important;
  background: transparent !important;
}
betty-bot #input-group {
  display: flex !important;
  align-items: flex-end !important;
  gap: var(--space-2) !important;
  background: var(--white) !important;
  border: 2px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  padding: 0.625rem 0.75rem 0.625rem 1.25rem !important;
  box-shadow: 0 2px 12px rgba(61, 18, 82, 0.06) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
betty-bot #input-group:focus-within {
  border-color: var(--plum) !important;
  box-shadow: 0 2px 20px rgba(61, 18, 82, 0.1) !important;
}
betty-bot #input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 1rem !important;
  font-family: var(--font-body) !important;
  padding: 0.5rem 0 !important;
  resize: none !important;
  flex: 1 !important;
  min-height: 24px !important;
  color: var(--text-primary) !important;
}
betty-bot #input::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.6 !important;
}
betty-bot #btnSend {
  background: var(--plum) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background 0.2s !important;
  flex-shrink: 0 !important;
  color: var(--white) !important;
}
betty-bot #btnSend:hover { background: var(--black) !important; }
betty-bot #btnSend svg {
  fill: var(--white) !important;
  color: var(--white) !important;
}
betty-bot #downloadChat {
  background: var(--off-white) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  color: var(--text-muted) !important;
  transition: background 0.2s !important;
}
betty-bot #downloadChat:hover { background: var(--light-plum) !important; }
betty-bot .form-group { margin: 0 !important; }

/* ===== Chat messages ===== */
betty-bot .d-flex {
  display: flex !important;
  gap: var(--space-3) !important;
  margin-bottom: var(--space-6) !important;
  align-items: flex-start !important;
}
betty-bot .avatar {
  flex-shrink: 0 !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
betty-bot .avatar img { display: none !important; }
betty-bot .questionRow .avatar {
  background: var(--plum) !important;
  position: relative !important;
}
betty-bot .questionRow .avatar::after {
  content: "Y" !important;
  color: var(--white) !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  font-family: var(--font-body) !important;
}
betty-bot .answerRow .avatar {
  background: var(--light-plum) !important;
  position: relative !important;
}
betty-bot .answerRow .avatar::after {
  content: "B" !important;
  color: var(--plum) !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  font-family: var(--font-body) !important;
}
betty-bot .chatBubble {
  flex: 1 !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
betty-bot .questionRow .chatBubble {
  background: var(--light-plum) !important;
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px !important;
  padding: 0.875rem 1.125rem !important;
}
betty-bot .questionRow .chatBubbleText {
  font-size: 0.9375rem !important;
  line-height: 1.6 !important;
  color: var(--text-primary) !important;
  font-family: var(--font-body) !important;
}
betty-bot .questionRow .chatBubbleText p { margin: 0 !important; }
betty-bot .answerRow .chatBubble {
  background: var(--white) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px !important;
  padding: 1rem 1.25rem !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
}
betty-bot .answerRow .chatBubbleText {
  font-size: 0.9375rem !important;
  line-height: 1.7 !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-body) !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}
betty-bot .answerRow .chatBubbleText p { margin: 0 0 0.75rem 0 !important; }
betty-bot .answerRow .chatBubbleText p:last-child { margin-bottom: 0 !important; }
betty-bot .answerRow .chatBubbleText ul,
betty-bot .answerRow .chatBubbleText ol {
  margin: 0.5rem 0 0.75rem 0 !important;
  padding-left: 1.25rem !important;
}
betty-bot .answerRow .chatBubbleText li {
  margin-bottom: 0.5rem !important;
  line-height: 1.6 !important;
}
betty-bot .answerRow .chatBubbleText a {
  color: var(--plum) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
betty-bot .answerRow .chatBubbleText a:hover { text-decoration: underline !important; }
betty-bot .answerRow .chatBubbleText strong {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}
betty-bot .chatButtons {
  display: flex !important;
  gap: 0.25rem !important;
  margin-top: 0.5rem !important;
  padding: 0 !important;
}
betty-bot .chatButtons button {
  background: transparent !important;
  border: none !important;
  padding: 0.375rem !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  color: var(--text-muted) !important;
  transition: background 0.15s, color 0.15s !important;
}
betty-bot .chatButtons button:hover {
  background: var(--off-white) !important;
  color: var(--plum) !important;
}

/* ===== Thinking indicator ===== */
.betty-thinking {
  display: none;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) 0;
}
.betty-thinking.active { display: flex; }
.betty-thinking__avatar {
  width: 32px;
  height: 32px;
  background: var(--light-plum);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--plum);
  font-weight: 700;
  font-size: 0.8125rem;
  font-family: var(--font-body);
}
.betty-thinking__dots {
  display: flex;
  align-items: center;
  gap: 4px;
}
.betty-thinking__dots span {
  width: 8px;
  height: 8px;
  background: var(--plum);
  opacity: 0.4;
  border-radius: 50%;
  animation: betty-pulse 1.4s ease-in-out infinite;
}
.betty-thinking__dots span:nth-child(2) { animation-delay: 0.2s; }
.betty-thinking__dots span:nth-child(3) { animation-delay: 0.4s; }
.betty-thinking__label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.25rem;
}
@keyframes betty-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
  
/* ========================================
   CHAT BUBBLE HEADINGS
   Force all headings inside the widget to be one step
   above body text, regardless of where they're nested
   ======================================== */
betty-bot h1,
betty-bot h2,
betty-bot h3,
betty-bot h4,
betty-bot h5,
betty-bot h6 {
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
  margin: 1rem 0 0.5rem 0 !important;
  color: var(--text-primary) !important;
  font-family: var(--font-body) !important;
}

betty-bot h1:first-child,
betty-bot h2:first-child,
betty-bot h3:first-child,
betty-bot h4:first-child,
betty-bot h5:first-child,
betty-bot h6:first-child {
  margin-top: 0 !important;
}