/* MeowL widget — neutral greyscale skin, brand accents used sparingly. */
.meowl-widget {
  --meowl-ink: #2E2E2E;
  --meowl-surface: #FFFFFF;
  --meowl-bg: #F2F4F5;
  --meowl-line: #E4E7EA;
  --meowl-muted: #7A7F85;
  --meowl-accent: #009FFD;
  --meowl-danger: #EF5455;
}

.meowl-widget-bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--meowl-bg) center/cover no-repeat;
  background-image: url('/wp-content/uploads/avatars/1/64b5511f10d3d-bpfull.jpg');
  border: 2px solid var(--meowl-surface);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  padding: 0;
  z-index: 99990; /* below cookie-consent (999999) + page-loader (99999) overlays */
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}
.meowl-widget-bubble:hover { transform: scale(1.05); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22); }
.meowl-widget-bubble.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.92);
}

.meowl-widget-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 40px);
  background: var(--meowl-bg);
  border: 1px solid var(--meowl-line);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(46, 46, 46, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 99990; /* below page-loader (99999) + cookie-consent overlays */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--meowl-ink);
}
.meowl-widget-panel.open { display: flex; }
.meowl-widget-panel { transition: width .2s ease, height .2s ease; }
.meowl-widget-panel.maximized {
  width: min(720px, calc(100vw - 40px));  /* fixed readable column, not full width */
  height: calc(100vh - 40px);             /* tall — more history visible */
}

/* Neutralise theme button styles inside the widget. BuddyBoss paints a
   border + light background on every <button>; force them off with
   !important because theme rules win on specificity in some contexts. */
.meowl-widget-panel button {
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  text-shadow: none;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  transform: none !important;
}
.meowl-widget-panel button:hover,
.meowl-widget-panel button:focus,
.meowl-widget-panel button:focus-visible,
.meowl-widget-panel button:active {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none !important;
}

.meowl-widget-header {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
}
/* Brand cluster: round avatar + title sitting together on the left. */
.meowl-widget-header .meowl-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
/* Round avatar. Explicit box + !important guards against the BuddyBoss theme
   leaking max-width/border styles into our <img>. */
.meowl-widget-header .meowl-avatar {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border: 0;
  background: var(--meowl-muted, #e5e5e5);
}
.meowl-widget-header .meowl-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--meowl-ink);
  display: inline-flex;
  align-items: baseline;
}
.meowl-turns {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--meowl-muted);
  margin-left: 6px;
}
.meowl-header-actions { display: flex; gap: 2px; align-items: center; }
/* Header icons are bare clickable icons, not pill buttons: no background in any
   state (transparent !important beats the theme's button:focus/:hover background),
   just a colour shift on hover. */
.meowl-widget-header .meowl-close,
.meowl-widget-header .meowl-maximize {
  background: transparent !important;
  color: var(--meowl-muted);
  cursor: pointer;
  line-height: 1;
  padding: 6px 8px;
  font-size: 15px;
  height: 28px;
  min-width: 28px;
  transition: color 0.12s ease;
}
/* All three header icons are SVGs in flex-centered boxes of equal height, so
   they share the same vertical centre line (text glyphs would sit off-centre on
   the baseline). */
.meowl-widget-header .meowl-close,
.meowl-widget-header .meowl-maximize {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.meowl-maximize svg,
.meowl-close svg,
.meowl-menu-btn svg { display: block; }
/* Close glyph reads heavier than the maximize outline at the same box size, so
   trim it a touch to look the same weight. */
.meowl-close svg { width: 15px; height: 15px; }
.meowl-widget-panel:not(.maximized) .meowl-ic-collapse { display: none; }
.meowl-widget-panel.maximized .meowl-ic-expand { display: none; }
.meowl-widget-header .meowl-close:hover,
.meowl-widget-header .meowl-close:focus,
.meowl-widget-header .meowl-maximize:hover,
.meowl-widget-header .meowl-maximize:focus {
  background: transparent !important;
  color: var(--meowl-ink);
}

/* App (Preact) mount — must be a flex column that fills the panel below the
   header, so .meowl-widget-log (flex:1) gets a bounded height and scrolls.
   Without this the v2 mount defaults to display:block, breaking the flex chain
   → the log grows with content and the composer overflows the panel (no scroll). */
.meowl-widget-mount {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.meowl-widget-log {
  flex: 1;
  min-height: 0;
  padding: 6px 16px 10px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
  background: var(--meowl-bg);
}
.meowl-msg {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}
.meowl-msg:last-child { margin-bottom: 4px; }
.meowl-msg-role { display: none; }

.meowl-msg-user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--meowl-ink);
  color: var(--meowl-surface);
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.meowl-msg-assistant {
  align-self: flex-start;
  max-width: 92%;
  background: var(--meowl-surface);
  color: var(--meowl-ink);
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  border: 1px solid var(--meowl-line);
  overflow-wrap: anywhere;
}
.meowl-msg-assistant p { margin: 0 0 8px; }
.meowl-msg-assistant p:last-child { margin-bottom: 0; }
.meowl-msg-assistant ul,
.meowl-msg-assistant ol { margin: 4px 0 8px 20px; padding: 0; }
.meowl-msg-assistant li { margin: 2px 0; }
.meowl-msg-assistant strong { font-weight: 600; }
.meowl-msg-assistant a,
.meowl-msg-assistant a:hover,
.meowl-msg-assistant a:focus {
  color: var(--meowl-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  /* Inherit weight from context (bold inside <strong>, normal otherwise) and pin it
     across states — the theme's global a:hover changes font-weight, which reflows
     the text and makes it "jump". !important beats the theme. */
  font-weight: inherit !important;
}
.meowl-msg-assistant a:hover { text-decoration-thickness: 2px; }
.meowl-msg-assistant code {
  background: var(--meowl-bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
}
/* Markdown headings (## / ###) — the LLM emits these; render as weighted lines. */
.meowl-msg-assistant .meowl-md-h { font-weight: 600; line-height: 1.3; margin: 8px 0 4px; }
.meowl-msg-assistant .meowl-md-h:first-child { margin-top: 0; }
.meowl-msg-assistant .meowl-md-h1 { font-size: 15px; }
.meowl-msg-assistant .meowl-md-h2 { font-size: 14px; }
.meowl-msg-assistant .meowl-md-h3,
.meowl-msg-assistant .meowl-md-h4 { font-size: 13px; }
/* Markdown pipe tables — render at the table's natural width with a horizontal
   scrollbar instead of squeezing columns to fit the chat panel. */
.meowl-md-table-wrap { overflow-x: auto; max-width: 100%; margin: 6px 0; }
.meowl-msg-assistant .meowl-md-table {
  border-collapse: collapse;
  font-size: 12px;
  /* Size to content, not the container: when the table is wider than the panel
     the wrap above scrolls horizontally instead of wrapping the cell text. */
  width: max-content;
  max-width: none;
}
.meowl-msg-assistant .meowl-md-table th,
.meowl-msg-assistant .meowl-md-table td {
  border: 1px solid var(--meowl-line);
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.meowl-msg-assistant .meowl-md-table th { background: var(--meowl-bg); font-weight: 600; }
/* The BuddyBoss theme forces `table td a { width:36px }` onto links in any cell —
   keep links in our table cells at their natural width. */
.meowl-msg-assistant .meowl-md-table td a,
.meowl-msg-assistant .meowl-md-table th a { width: auto; line-height: inherit; }

/* WordPress core swaps inline emoji to <img class="emoji"> (when the client lacks an
   emoji font); BuddyBoss then pins them at 24px and breaks the compact UI. Scale to
   the surrounding font, like the site's webinar cards (.webinar-html-card img.emoji). */
.meowl-widget-panel img.emoji {
  display: inline;
  width: 1em;
  height: 1em;
  margin: 0 .1em;
  vertical-align: -.1em;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: none;
}

.meowl-msg-assistant.typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 12px 14px;
}
.meowl-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--meowl-muted);
  animation: meowl-typing 1.3s infinite ease-in-out;
}
.meowl-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.meowl-typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes meowl-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%          { opacity: 1;   transform: translateY(-3px); }
}

.meowl-msg-system {
  align-self: center;
  width: fit-content;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  color: var(--meowl-muted);
  font-size: 12px;
  padding: 6px 12px;
  background: rgba(46, 46, 46, 0.04);
  border-radius: 999px;
  text-align: center;
}

.meowl-msg-error {
  align-self: center;
  color: var(--meowl-danger);
  font-size: 12px;
  padding: 8px 12px;
  background: rgba(239, 84, 85, 0.08);
  border-radius: 10px;
  max-width: 92%;
  white-space: pre-wrap;
  text-align: left;
}

.meowl-citations {
  align-self: flex-start;
  font-size: 12px;
  color: var(--meowl-muted);
  margin-top: 6px;
  max-width: 92%;
  padding: 0 2px;
  line-height: 1.5;
}
.meowl-citations a {
  color: var(--meowl-accent);
  text-decoration: none;
}
.meowl-citations a:hover { text-decoration: underline; }

/* ── P1-3 additions ──────────────────────────────────────────────────── */

/* Mode banners — pinned at top of log, full-width pill */
.meowl-banner {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
}
.meowl-banner-operator {
  background: rgba(0, 159, 253, 0.10);
  color: var(--meowl-accent);
  border: 1px solid rgba(0, 159, 253, 0.25);
}
.meowl-banner-ticket {
  background: rgba(122, 127, 133, 0.10);
  color: var(--meowl-muted);
  border: 1px solid var(--meowl-line);
}

/* Operator turns — left-aligned like assistant, accent left border */
.meowl-msg-operator-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--meowl-accent);
  margin-bottom: 3px;
  padding-left: 2px;
}
.meowl-msg-operator {
  align-self: flex-start;
  max-width: 92%;
  background: var(--meowl-surface);
  color: var(--meowl-ink);
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  border: 1px solid var(--meowl-line);
  border-left: 3px solid var(--meowl-accent);
  overflow-wrap: anywhere;
}
.meowl-msg-operator p { margin: 0 0 8px; }
.meowl-msg-operator p:last-child { margin-bottom: 0; }

/* Identity form — inline inside the log */
.meowl-identity-form-wrapper {
  background: var(--meowl-surface);
  border: 1px solid var(--meowl-line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.meowl-identity-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Kill the theme's bottom margin on <form> (BuddyBoss sets one); our spacing
     is the wrapper's margin-bottom, not the form's. !important beats the theme. */
  margin-bottom: 0 !important;
}
.meowl-identity-form-title {
  font-size: 13px;
  color: var(--meowl-ink);
  font-weight: 500;
  line-height: 1.4;
}
.meowl-identity-email,
.meowl-identity-name {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--meowl-line);
  background: var(--meowl-bg);
  border-radius: 10px;
  font-size: 13px !important;        /* beat theme's 16px input rule; match the title */
  color: var(--meowl-ink);
  outline: none;
  font-family: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.meowl-identity-email::placeholder,
.meowl-identity-name::placeholder { color: var(--meowl-muted); }
.meowl-identity-email:focus,
.meowl-identity-name:focus {
  border-color: var(--meowl-accent);
  box-shadow: 0 0 0 3px rgba(0, 159, 253, 0.12);
}
.meowl-identity-consent {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px !important;        /* beat theme label sizing */
  color: var(--meowl-muted);
  line-height: 1.4;
  cursor: pointer;
}
.meowl-identity-checkbox {
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--meowl-accent);
  cursor: pointer;
}
.meowl-identity-submit {
  align-self: flex-start;
  background: var(--meowl-accent) !important;
  color: #fff !important;
  border-radius: 10px !important;
  padding: 0 18px !important;
  height: 36px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px !important;        /* beat theme button sizing */
  font-family: inherit;
  transition: opacity 0.12s ease;
}
.meowl-identity-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.meowl-identity-submit:hover:not(:disabled) { opacity: 0.85; }

/* Escalate button — compact, in the header actions row */
.meowl-escalate-btn {
  background: transparent;
  color: var(--meowl-muted);
  cursor: pointer;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 14px;
  height: 28px;
  min-width: 28px;
  transition: background 0.12s ease, color 0.12s ease;
}
.meowl-escalate-btn:hover {
  background: rgba(0, 159, 253, 0.08);
  color: var(--meowl-accent);
}

/* Feedback thumbs row — appears below each assistant message */
.meowl-feedback {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding-left: 2px;
}
/* Retry bar sits under the user bubble, which is right-aligned (align-self:flex-end);
   match it so the button lines up under the message instead of drifting to the left. */
.meowl-retry { align-self: flex-end; padding-left: 0; padding-right: 2px; }
.meowl-feedback-btn {
  background: transparent;
  color: var(--meowl-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}
/* Outline thumb icons — uniform 14px box so up/down align exactly. */
.meowl-fb-icon { display: block; width: 14px; height: 14px; }
.meowl-feedback-btn:hover:not(:disabled) {
  background: rgba(46, 46, 46, 0.06);
  color: var(--meowl-ink);
}
.meowl-feedback-btn:disabled { opacity: 0.35; cursor: not-allowed; }
/* Pin the thumb buttons borderless on every state so the theme's button:hover
   (which can add a border/outline) can't grow their width on hover. The
   .meowl-widget-panel prefix beats the theme's `button:hover` specificity. */
.meowl-widget-panel .meowl-feedback-btn,
.meowl-widget-panel .meowl-feedback-btn:hover {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}
.meowl-feedback-ack {
  font-size: 11px;
  color: var(--meowl-muted);
  margin-left: 4px;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.meowl-feedback-ack--fading { opacity: 0; }

/* Dislike category mini-menu */
.meowl-feedback-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  padding-left: 2px;
}
/* .meowl-widget-panel prefix + !important: the chip pill (bg/border/radius)
   was flattened to plain text by the theme's bare-<button> reset — pin it. */
.meowl-widget-panel .meowl-feedback-menu-item {
  background: var(--meowl-surface) !important;
  color: var(--meowl-ink) !important;
  font-size: 12px;
  /* Pin the metrics the BuddyBoss button:hover reset would otherwise change
     (bold weight, lift transform, shadow) — those resize/shift the pill and make
     it "jump" on hover. With these pinned, hover only recolors. */
  font-weight: 500 !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
  transform: none !important;
  box-shadow: none !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  border: 1px solid var(--meowl-line) !important;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}
.meowl-widget-panel .meowl-feedback-menu-item:hover {
  background: rgba(0, 159, 253, 0.07) !important;
  /* Re-assert the FULL border (width+style), not just the color — the theme's
     button:hover zeroed the border-width on hover, shrinking the pill by 2px
     (the width "jitter"). Pinning the whole border keeps the box size constant. */
  border: 1px solid var(--meowl-accent) !important;
  color: var(--meowl-accent) !important;
  font-weight: 500 !important;
  transform: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.meowl-widget-form {
  padding: 8px 16px 16px;
  background: var(--meowl-bg);
  margin: 0;
}
/* Composer: a bordered rounded "field" (the container) holding the textarea and the
   send button side by side, like leading LLM UIs. The textarea is borderless and
   auto-grows up to ~3 lines (its own thin scrollbar past that); the button is a
   separate bottom-aligned child, so it never overlaps the scrollbar. */
.meowl-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border: 1px solid var(--meowl-line);
  background: var(--meowl-surface);
  border-radius: 14px;
  padding: 5px 5px 5px 14px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.meowl-composer:focus-within {
  border-color: var(--meowl-accent);
}
.meowl-composer-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  resize: none;
  font-size: 14px !important;        /* match chat; beat theme's 16px input rule */
  line-height: 20px !important;
  max-height: 72px;                  /* ~3 lines (20*3 + vertical padding) */
  overflow-y: auto;
  padding: 6px 0;
  margin: 0;
  color: var(--meowl-ink);
  font-family: inherit;
  box-shadow: none !important;       /* kill the theme's textarea:focus shadow leak */
  scrollbar-width: thin;
  scrollbar-color: var(--meowl-line) transparent;
}
.meowl-composer-input::placeholder { color: var(--meowl-muted); }
.meowl-composer-input::-webkit-scrollbar { width: 8px; }
.meowl-composer-input::-webkit-scrollbar-thumb { background: var(--meowl-line); border-radius: 4px; }
.meowl-composer-send {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--meowl-ink) !important;
  color: var(--meowl-surface) !important;
  border-radius: 9px !important;     /* rounded rectangle, not a circle */
  padding: 0 !important;
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease;
}
.meowl-composer-send svg { display: block; }
.meowl-composer-send:hover:not(:disabled) { background: #000 !important; }
.meowl-composer-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Widget v2 — contextual offer + overflow menu */
/* Compact single row: prompt (left, grows) + small accent action + ✕ dismiss.
   text-align:left overrides .meowl-banner's centering; align-items:center keeps
   the buttons vertically aligned if the prompt wraps to two lines. */
.meowl-offer { display: flex; align-items: center; gap: 8px; text-align: left; }
.meowl-offer-text { flex: 1; font-weight: 400; line-height: 1.35; }
/* .meowl-widget-panel prefix + !important: the BuddyBoss theme styles bare
   <button> (dark fill, padding) and beats single-class rules — pin our intent. */
.meowl-widget-panel .meowl-offer-accept {
  background: var(--meowl-accent) !important; color: #fff !important;
  border: none !important; border-radius: 6px !important;
  padding: 5px 10px !important; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer;
}
.meowl-widget-panel .meowl-offer-accept:hover { opacity: 0.9; }
.meowl-widget-panel .meowl-offer-dismiss {
  background: transparent !important; color: var(--meowl-muted) !important;
  border: none !important; border-radius: 6px !important;
  padding: 2px 5px !important; font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
.meowl-widget-panel .meowl-offer-dismiss:hover { color: var(--meowl-ink) !important; }
.meowl-adopt { display: flex; align-items: center; gap: 8px; text-align: left; flex-wrap: wrap; }
.meowl-adopt-text { flex: 1 1 100%; font-weight: 400; line-height: 1.35; }
.meowl-widget-panel .meowl-adopt-add {
  background: var(--meowl-accent) !important; color: #fff !important;
  border: none !important; border-radius: 8px !important; padding: 6px 12px !important;
  font: inherit; font-size: 13px !important; cursor: pointer !important;
}
.meowl-widget-panel .meowl-adopt-add:hover { opacity: 0.9; }
.meowl-widget-panel .meowl-adopt-keep {
  background: transparent !important; color: var(--meowl-muted) !important;
  border: 1px solid var(--meowl-line) !important; border-radius: 8px !important;
  padding: 6px 12px !important; font: inherit; font-size: 13px !important; cursor: pointer !important;
}
.meowl-widget-panel .meowl-adopt-keep:hover { color: var(--meowl-ink) !important; border: 1px solid var(--meowl-line) !important; }
.meowl-menu-inner { position: relative; }
.meowl-widget-panel .meowl-menu-btn { background: transparent !important; color: var(--meowl-muted) !important; border: none !important; cursor: pointer; font-size: 18px; line-height: 0; padding: 6px 8px; display: inline-flex; align-items: center; justify-content: center; height: 28px; min-width: 28px; }
.meowl-widget-panel .meowl-menu-btn:hover { color: var(--meowl-ink) !important; }
.meowl-menu { position: absolute; right: 0; top: 100%; background: var(--meowl-surface); border: 1px solid var(--meowl-line); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 10; min-width: 160px; }
.meowl-widget-panel .meowl-menu-item { display: block; width: 100%; text-align: left; background: transparent !important; color: var(--meowl-ink) !important; border: none !important; padding: 10px 12px; cursor: pointer; font-family: inherit; font-size: 14px !important; }
.meowl-widget-panel .meowl-menu-item:hover { background: var(--meowl-bg) !important; }

/* Mobile: the panel is always fullscreen; the maximize control is meaningless there. */
@media (max-width: 600px) {
  .meowl-widget-panel,
  .meowl-widget-panel.maximized {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    border: 0;
  }
  .meowl-widget-header .meowl-maximize { display: none; }

  /* WP admin bar is position:fixed at top:0 with z-index 99999 — above the panel
     (99990) — and on mobile it's 46px tall. The fullscreen panel sits at top:0
     (inset:0), so the bar covers the header and its close (×) button, making the
     chat impossible to close. Push the panel below the bar when it's present
     (body.admin-bar) so the header — and the × — clears it. */
  body.admin-bar .meowl-widget-panel,
  body.admin-bar .meowl-widget-panel.maximized {
    top: var(--wp-admin--admin-bar--height, 46px);
    /* The base rule sets height:100% (= full viewport). Pushing top down by the bar
       height without shrinking the height would overflow the bottom by the same
       amount and hide the composer off-screen — so subtract the bar height too. */
    height: calc(100% - var(--wp-admin--admin-bar--height, 46px));
  }
}

/* --- Rollout: the BuddyPanel "Chat" menu item is the launcher; hide the floating bubble. --- */
.meowl-widget-bubble { display: none !important; }

/* --- Rollout: side variants (base rules target right; left overrides) --- */
.meowl-widget-bubble.meowl-side-left { right: auto; left: 20px; }
.meowl-widget-panel.meowl-side-left { right: auto; left: 20px; }
@media (max-width: 600px) {
  .meowl-widget-panel.meowl-side-left { left: 0; right: 0; }  /* fullscreen ignores side */
}

/* --- Teaser balloon (chat-style, near the launcher) --- */
.meowl-teaser-mount { position: fixed; bottom: 20px; right: 20px; z-index: 99989; }
.meowl-teaser-mount.meowl-side-left { right: auto; left: 20px; }
.meowl-teaser {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 240px; padding: 10px 12px;
  color: var(--meowl-ink, #2E2E2E);
  border: 1px solid var(--meowl-line, #E4E7EA);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(46, 46, 46, 0.18);
  font: 500 13px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  /* One-shot horizontal shimmer (Claude-Code style): an accent highlight band
     sweeps left→right across the surface once to grab attention, then settles. */
  background-color: var(--meowl-surface, #fff);
  background-image: linear-gradient(100deg, transparent 18%, rgba(0, 159, 253, 0.34) 40%, rgba(239, 84, 85, 0.34) 58%, transparent 80%);
  background-repeat: no-repeat;
  background-size: 220% 100%;
  background-position: 180% 0;
  /* Periodic, unobtrusive: an ~1.4s sweep then a long rest, repeating every 8s. */
  animation: meowl-teaser-shimmer 8s ease-in-out 1s infinite;
}
@keyframes meowl-teaser-shimmer {
  0%   { background-position: 180% 0; }   /* band off the right */
  18%  { background-position: -80% 0; }   /* swept across to off the left (~1.4s) */
  100% { background-position: -80% 0; }   /* hold off-screen for the rest of the cycle */
}
@media (prefers-reduced-motion: reduce) {
  .meowl-teaser { animation: none; background-image: none; }
}
/* Tail pointing left toward the BuddyPanel "Chat" button when anchored to it. */
.meowl-teaser-anchored .meowl-teaser::before {
  content: ''; position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
  border-width: 6px 6px 6px 0; border-style: solid;
  border-color: transparent var(--meowl-surface, #fff) transparent transparent;
}
.meowl-teaser-text { flex: 1; }
.meowl-teaser-close {
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  color: var(--meowl-muted, #7A7F85); cursor: pointer; font-size: 16px; line-height: 1;
  padding: 0 2px; flex-shrink: 0;
}
.meowl-teaser-close:hover { color: var(--meowl-ink, #2E2E2E); background: transparent !important; }
