/* Strongly-scoped to the widget so we don't affect the rest of the site */
#lr-widget, #lr-widget * { box-sizing: border-box; }

/* Brand palette (Materialize light-blue/darken-3 family) */
:root {
  --lr-brand: #0B2A4A;   /* deep navy for header */
  --lr-primary: #0277BD; /* light-blue darken-3 */
  --lr-primary-strong: #01579B;
  --lr-text-on-dark: #ffffff;
  --lr-input-bg: #ffffff;
  --lr-bot-bubble: #ffffff;
  --lr-user-bubble: #E3F2FD; /* light-blue 50 */
  --lr-border: #e0e0e0;
}

/* Header bar */
#lr-widget .lr-header {
  background: var(--lr-brand) !important;
  color: var(--lr-text-on-dark) !important;
}

/* Launcher pill (bottom-right button) */
#lr-widget .lr-launcher {
  background: var(--lr-primary) !important;
  color: var(--lr-text-on-dark) !important;
  border-radius: 999px !important;
}

/* Send button */
#lr-widget .lr-send-btn {
  background: var(--lr-primary) !important;
  color: var(--lr-text-on-dark) !important;
}
#lr-widget .lr-send-btn:hover,
#lr-widget .lr-send-btn:focus { background: var(--lr-primary-strong) !important; }

/* Bubbles */
#lr-widget .lr-msg-bot  { background: var(--lr-bot-bubble)  !important; border:1px solid var(--lr-border); }
#lr-widget .lr-msg-user { background: var(--lr-user-bubble) !important; border:1px solid var(--lr-border); }

/* Input */
#lr-widget .lr-input      { background: var(--lr-input-bg) !important; }
#lr-widget .lr-input input::placeholder,
#lr-widget .lr-input textarea::placeholder { color:#607d8b; opacity:.9; }

/* HIDE source chips/badges completely */
#lr-widget .lr-sources,
#lr-widget .lr-source,
#lr-widget .lr-chip,
#lr-widget .chip { display:none !important; }


/* --- Laundrobot layout overrides (positioning & z-index) --- */

/* Put the whole widget on top of everything else */
#laundrobot-root {
  position: fixed !important;
  inset: auto 0 0 auto;        /* anchor to bottom-right corner */
  z-index: 2147483000 !important; /* above Materialize stuff */
  pointer-events: none;        /* allow clicks only on children */
}

/* Launcher button = floating pill, bottom-right */
#laundrobot-root .lr-launcher,
.laundrobot-launcher,
.lr-open-button,
.lr-fab,
.lr-cta-btn {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  left: auto !important;
  width: auto !important;
  min-width: 56px;
  height: 44px;
  border-radius: 9999px !important;
  padding: 0 16px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(2,136,209,.25) !important; /* nice lift */
  pointer-events: auto;
}

/* Chat window anchored above the launcher */
#laundrobot-root .lr-window,
#laundrobot-root .lr-drawer,
#laundrobot-root .lr-panel {
  position: fixed !important;
  right: 20px !important;
  bottom: 76px !important;           /* leave room for launcher */
  width: 380px !important;
  max-width: calc(100vw - 32px) !important;
  height: 520px !important;
  max-height: calc(100vh - 120px) !important;
  border-radius: 14px !important;
  overflow: hidden;
  pointer-events: auto;
}

/* Mobile: stretch a bit wider and taller */
@media (max-width: 480px) {
  #laundrobot-root .lr-window,
  #laundrobot-root .lr-drawer,
  #laundrobot-root .lr-panel {
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    height: 70vh !important;
    bottom: 72px !important;
  }
}

/* Prevent any “full-width footer bar” styles from taking over */
#laundrobot-root,
#laundrobot-root * {
  width: auto !important;
  max-width: none;
}

/* Hide any “sources” chips that might slip through */
#laundrobot-root .lr-message .lr-chip,
#laundrobot-root .lr-message [data-lr="sources"],
#laundrobot-root .lr-message [data-lr-source] {
  display: none !important;
}

/* If the placeholder shows weird ellipsis glyphs on some devices, use ... */
#laundrobot-root input::placeholder,
#laundrobot-root textarea::placeholder {
  content: 'Type your question...';
}
/* === Laundrobot custom panel (opaque + anchored) === */
#laundrobot-launch{
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  z-index: 2147483000 !important;
  border-radius: 9999px !important;
  height: 44px !important;
  padding: 0 16px !important;
  display: inline-flex !important;
  align-items: center; gap: 8px;
  background: #0288d1 !important; color: #fff !important;
  box-shadow: 0 8px 24px rgba(2,136,209,.25) !important;
}

#laundrobot-panel{
  position: fixed !important;
  right: 20px !important;
  bottom: 76px !important;               /* space above launcher */
  width: 380px !important;
  max-width: calc(100vw - 32px) !important;
  height: 520px !important;
  max-height: calc(100vh - 120px) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background: #ffffff !important;        /* <<< fixes transparency */
  box-shadow: 0 12px 36px rgba(0,0,0,.24) !important;
  z-index: 2147483001 !important;
}

/* Mobile sizing */
@media (max-width: 480px){
  #laundrobot-panel{
    right: 8px !important; left: 8px !important;
    width: auto !important; height: 70vh !important;
    bottom: 72px !important;
  }
}

/* Panel internals */
#lr-header{
  background: #0B2A4A !important;  /* deep navy */
  color: #fff !important;
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 12px;
}
#lr-messages{
  background:#fff !important;
  height: calc(100% - 112px);  /* header + inputbar */
  overflow-y:auto; padding:12px;
}
#lr-inputbar{
  display:flex; gap:8px; align-items:center;
  background:#f7f9fc !important; border-top:1px solid #e0e0e0;
  padding:10px;
}
#lr-text{
  width:100%; min-height:40px; max-height:100px; resize:vertical;
  border:1px solid #d0d7de; border-radius:8px; padding:8px 10px;
  background:#fff; font: inherit;
}
#lr-send{
  background:#0288d1 !important; color:#fff !important;
  border:none; border-radius:8px; height:40px; padding:0 16px;
  cursor:pointer;
}

/* Bubbles */
.lr-msg{ display:flex; margin:8px 0; }
.lr-msg.user{ justify-content:flex-end; }
.lr-msg.bot{ justify-content:flex-start; }
.lr-bubble{
  max-width:80%; padding:10px 12px; line-height:1.45;
  border-radius:12px; border:1px solid #e0e0e0; background:#fff;
}
.lr-msg.user .lr-bubble{ background:#E3F2FD; }

/* Spinner */
.lr-spinner{
  width:16px; height:16px; display:inline-block; border-radius:50%;
  border:2px solid #cfd8dc; border-top-color:#0288d1;
  animation: lrspin 0.9s linear infinite;
}
@keyframes lrspin{ to { transform: rotate(360deg); } }

/* Hide any source chips our loader might add */
#laundrobot-panel .lr-sources,
#laundrobot-panel .lr-chip{ display:none !important; }


/* --- FIX: keep header, messages, and input inside the panel --- */
#laundrobot-panel{
  display: flex !important;
  flex-direction: column !important;
}

#lr-header{
  flex: 0 0 auto !important;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: nowrap; gap: 8px;
  padding: 10px 12px;
  line-height: 1.2;
}

#lr-messages{
  flex: 1 1 auto !important;      /* grow to fill, never push input out */
  height: auto !important;         /* replace previous calc */
  overflow-y: auto; padding: 12px;
  background: #fff !important;
}

#lr-inputbar{
  flex: 0 0 auto !important;       /* always visible at the bottom */
  position: static !important;     /* no accidental absolute pos */
  width: 100% !important;
  display: flex; gap: 8px; align-items: center;
  background: #f7f9fc !important; border-top: 1px solid #e0e0e0;
  padding: 10px;
  box-sizing: border-box;
}

#lr-text{
  flex: 1 1 auto; min-width: 0;    /* prevent flex overflow */
  width: 100%; box-sizing: border-box;
  min-height: 40px; max-height: 100px; resize: vertical;
  border: 1px solid #d0d7de; border-radius: 8px; padding: 8px 10px;
  background: #fff; font: inherit;
}

#lr-send{
  flex: 0 0 auto;
  height: 40px; padding: 0 16px;
  border-radius: 8px; border: none;
  background: #0288d1 !important; color: #fff !important;
  cursor: pointer;
}

/* keep the close icon from wrapping under the title on narrow widths */
#lr-header > button#lr-close{ flex: 0 0 auto; }
#lr-header > div{ min-width: 0; }  /* allow text to wrap before pushing the button */



/* === Laundrobot (homegrown) panel/layout fixes === */

/* Floating launcher pill (your #laundrobot-launch button) */
#laundrobot-launch{
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  z-index: 2147483000 !important;
  border-radius: 9999px !important;
  padding: 0 16px !important;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(2,136,209,.25) !important;
  text-transform: none; /* keep label readable */
}

/* Chat window (the panel your script injects) */
#laundrobot-panel{
  position: fixed !important;
  right: 20px !important;
  bottom: 76px !important;                 /* space above the launcher */
  width: 380px !important;
  max-width: calc(100vw - 32px) !important;
  height: 520px !important;
  max-height: calc(100vh - 120px) !important;
  display: none;                            /* closed by default; JS toggles */
  background: #ffffff !important;           /* no transparency */
  border-radius: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.18) !important;
  z-index: 2147483000 !important;
  box-sizing: border-box;
  /* keep children stacked correctly */
  display: flex !important;
  flex-direction: column !important;
}

/* Header */
#lr-header{
  flex: 0 0 auto !important;
  background: #0B2A4A !important;          /* deep navy header */
  color: #fff !important;
  padding: 10px 12px !important;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; line-height: 1.2;
}
#lr-header > div{ min-width: 0; }           /* avoid pushing close btn down */
#lr-header #lr-close{ flex: 0 0 auto; }

/* Messages area */
#lr-messages{
  flex: 1 1 auto !important;                /* grows, doesn’t push input out */
  overflow-y: auto !important;
  padding: 12px !important;
  background: #fff !important;
}

/* Simple bubbles to keep text readable */
#laundrobot-panel .lr-msg{ margin: 6px 0; }
#laundrobot-panel .lr-bubble{
  background: #ffffff; border: 1px solid #e5e7eb;
  border-radius: 12px; padding: 10px 12px;
  color: #111827;
}

/* Input row */
#lr-inputbar{
  flex: 0 0 auto !important;
  display: flex; align-items: center; gap: 8px;
  padding: 10px; background: #f7f9fc; border-top: 1px solid #e0e0e0;
  box-sizing: border-box;
}
#lr-text{
  flex: 1 1 auto; min-width: 0;
  width: 100%; min-height: 40px; max-height: 120px; resize: vertical;
  border: 1px solid #d0d7de; border-radius: 8px; padding: 8px 10px;
  font: inherit; background: #fff;
}
#lr-text::placeholder{ color:#607d8b; opacity:.95; }

/* Send button */
#lr-send{
  flex: 0 0 auto; height: 40px; padding: 0 16px;
  border-radius: 8px; border: none;
  background: #0288d1 !important; color: #fff !important;
  cursor: pointer;
}

/* Hide “sources” chips created by the script */
#laundrobot-panel .lr-sources,
#laundrobot-panel .lr-chip{ display:none !important; }

/* Mobile sizing */
@media (max-width: 480px){
  #laundrobot-panel{
    right: 8px !important; left: 8px !important;
    width: auto !important; height: 70vh !important; bottom: 72px !important;
  }
}


/* Laundrobot visibility control (immune to other CSS) */
#laundrobot-panel { display: none !important; }
#laundrobot-panel.lr-open { display: flex !important; }
