/* Flu Flu widget (Lane D, 2026-10-28). Self-contained: shared by the home page, the member portal and the admin page. */
.ff-root {
  --ff-red: #C8372D; --ff-red-d: #9E2820; --ff-gold: #F4C95D; --ff-cream: #FFF8EC; --ff-ink: #3A2410; --ff-mut: #7A5F48;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ff-ink);
  font-size: 15px; line-height: 1.5; box-sizing: border-box;
}
.ff-root *, .ff-root *::before, .ff-root *::after { box-sizing: border-box; }

/* Floating launcher */
.ff-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 9000; display: flex; align-items: center; gap: 10px;
  padding: 5px 18px 5px 5px; border: 0; border-radius: 999px; cursor: pointer; color: #fff; font: 800 15px/1 inherit; font-family: inherit;
  background: linear-gradient(135deg, #E0483A 0%, var(--ff-red) 55%, var(--ff-red-d) 100%);
  box-shadow: 0 10px 28px rgba(122, 31, 23, .42), 0 0 0 3px rgba(244, 201, 93, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ff-fab img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; background: #cfe6f5; display: block; }
.ff-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 14px 32px rgba(122, 31, 23, .5), 0 0 0 3px var(--ff-gold), 0 0 22px rgba(244, 201, 93, .6); }
.ff-fab:focus-visible, .ff-close:focus-visible, .ff-chip:focus-visible, .ff-send:focus-visible, .ff-input:focus-visible, .ff-log:focus-visible { outline: 3px solid #1b6cff; outline-offset: 2px; }
.ff-root.is-open .ff-fab { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .ff-fab { animation: ffBob 4.5s ease-in-out 1.5s 3; }
  @keyframes ffBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
}

/* Panel */
.ff-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 9001; width: min(392px, calc(100vw - 24px)); height: min(600px, calc(100vh - 36px));
  display: none; flex-direction: column; overflow: hidden; border-radius: 22px; background: var(--ff-cream);
  border: 3px solid var(--ff-gold); box-shadow: 0 24px 60px rgba(58, 36, 16, .38), 0 0 0 1px rgba(122, 31, 23, .12);
}
.ff-root.is-open .ff-panel { display: flex; }
@media (prefers-reduced-motion: no-preference) { .ff-root.is-open .ff-panel { animation: ffPop .22s ease-out; } @keyframes ffPop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } } }

.ff-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, #E0483A, var(--ff-red) 60%, var(--ff-red-d)); }
.ff-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; flex: none; background: #cfe6f5; box-shadow: 0 0 0 2px rgba(244, 201, 93, .9); }
.ff-ht { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ff-name { font: 800 17px/1.15 "Fraunces", Georgia, serif; letter-spacing: .01em; }
.ff-sub { font-size: 12.5px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ff-close { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .18); }
.ff-close:hover { background: rgba(255, 255, 255, .3); }

.ff-log { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 9px; scroll-behavior: smooth; overscroll-behavior: contain; }
.ff-msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
.ff-msg p { margin: 0 0 .45em; } .ff-msg p:last-child { margin-bottom: 0; }
.ff-msg ul { margin: .2em 0 .2em 1.1em; padding: 0; } .ff-msg li { margin: .15em 0; }
.ff-msg a { color: var(--ff-red-d); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.ff-bot { align-self: flex-start; background: #fff; border: 1.5px solid #F0DFC2; border-top-left-radius: 5px; box-shadow: 0 2px 6px rgba(58, 36, 16, .06); }
.ff-user { align-self: flex-end; color: #fff; font-weight: 600; background: linear-gradient(135deg, #E0483A, var(--ff-red-d)); border-top-right-radius: 5px; }
.ff-err { border-color: #E3A29B; background: #FFF1EF; }
.ff-capped { border-color: var(--ff-gold); background: #FFF7DC; }
.ff-typing { display: flex; gap: 5px; padding: 12px 14px; }
.ff-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--ff-red); opacity: .35; }
@media (prefers-reduced-motion: no-preference) { .ff-typing span { animation: ffDot 1.1s infinite ease-in-out; } .ff-typing span:nth-child(2) { animation-delay: .18s; } .ff-typing span:nth-child(3) { animation-delay: .36s; } @keyframes ffDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } } }
@media (prefers-reduced-motion: reduce) { .ff-typing span { opacity: .8; } .ff-log { scroll-behavior: auto; } }

.ff-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 14px 10px; }
.ff-chips[hidden] { display: none; }
.ff-chip { cursor: pointer; border: 2px solid var(--ff-gold); background: #fff; color: var(--ff-ink); font: 700 13px/1.2 inherit; font-family: inherit; padding: 7px 12px; border-radius: 999px; text-align: left; }
.ff-chip:hover { background: #FFF1C9; }

.ff-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; border-top: 2px solid #F0DFC2; background: #fff; }
.ff-input { flex: 1; resize: none; max-height: 110px; min-height: 42px; padding: 10px 13px; border-radius: 14px; border: 2px solid #E8D3AE; background: var(--ff-cream); color: var(--ff-ink); font: 600 16px/1.35 inherit; font-family: inherit; }
.ff-send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #E0483A, var(--ff-red-d)); box-shadow: 0 4px 10px rgba(122, 31, 23, .3); }
.ff-send:disabled { opacity: .5; cursor: default; }
.ff-note { margin: 0; padding: 2px 14px 10px; background: #fff; font-size: 11.5px; color: var(--ff-mut); text-align: center; }

/* Phones: bottom sheet */
@media (max-width: 600px) {
  .ff-fab { right: 12px; bottom: 12px; padding-right: 14px; }
  .ff-panel { right: 0; left: 0; bottom: 0; width: 100%; height: min(86vh, 640px); border-radius: 22px 22px 0 0; border-width: 3px 0 0; }
  .ff-root.is-open::before { content: ""; position: fixed; inset: 0; z-index: 9000; background: rgba(40, 20, 8, .45); }
  .ff-msg { max-width: 94%; }
}
@media (max-width: 340px) { .ff-fab-lbl { display: none; } .ff-fab { padding-right: 5px; } .ff-chip { font-size: 12.5px; } }

/* Embedded (admin page): inline card instead of floating */
.ff-embed .ff-panel { position: static; display: flex; width: 100%; height: min(560px, 70vh); min-height: 360px; box-shadow: 0 10px 30px rgba(58, 36, 16, .15); animation: none; }
.ff-embed.is-open::before { display: none; }
@media (max-width: 600px) { .ff-embed .ff-panel { border-radius: 18px; border-width: 3px; width: 100%; } }
@media print { .ff-root { display: none !important; } }

/* ── Cody 2026-10-28 (e2e fixes): never cover the theater player or the open home menu; on phones and on admin
      pages the launcher is the round Flu Flu face only, so it hides less of the page. ── */
html.fpp-lock .ff-root { display: none !important; }
body:has(#navLinks.open) .ff-fab { display: none; }
.ff-ctx-admin .ff-fab-lbl { display: none; }
.ff-ctx-admin .ff-fab { padding: 4px; }
.ff-ctx-admin .ff-fab img { width: 46px; height: 46px; }
@media (max-width: 600px) {
  .ff-fab-lbl { display: none; }
  .ff-fab { padding: 4px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .ff-fab img { width: 48px; height: 48px; }
}
