/* FutureWell: circulars UI.
   1) the floating "Circulars" button + panel (assets/js/circulars-widget.js, shown on every page)
   2) the /circulars page (assets/js/pages/circulars-main.js)
   A real file because the site CSP blocks inline <style>. Light + dark follow the visitor's system setting,
   same as the rest of the site. */
:root {
  --fwc-bg: #ffffff; --fwc-bg2: #f5f3ff; --fwc-ink: #1e1b4b; --fwc-mute: #6b6890;
  --fwc-line: #e4def4; --fwc-brand: #6d28d9; --fwc-brand-ink: #ffffff;
  --fwc-shadow: 0 18px 50px rgba(30, 20, 70, .22);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fwc-bg: #171429; --fwc-bg2: #211c3a; --fwc-ink: #f3f1fb; --fwc-mute: #a29fbd;
    --fwc-line: #2e2850; --fwc-brand: #8b5cf6; --fwc-brand-ink: #ffffff;
    --fwc-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  }
}

/* tag colours (the admin "Color" choices) */
.fwc-tag, .fwcp-tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #ede9fe; color: #5b21b6; }
.fwc-tag[data-c="amber"], .fwcp-tag[data-c="amber"] { background: #fef3c7; color: #78350f; }
.fwc-tag[data-c="purple"], .fwcp-tag[data-c="purple"] { background: #f3e8ff; color: #6b21a8; }
.fwc-tag[data-c="emerald"], .fwcp-tag[data-c="emerald"] { background: #d1fae5; color: #064e3b; }
.fwc-tag[data-c="slate"], .fwcp-tag[data-c="slate"] { background: #e2e8f0; color: #1e293b; }
@media (prefers-color-scheme: dark) {
  .fwc-tag, .fwcp-tag { background: #3b2a7a; color: #ddd6fe; }
  .fwc-tag[data-c="amber"], .fwcp-tag[data-c="amber"] { background: #5c3d0a; color: #fde68a; }
  .fwc-tag[data-c="purple"], .fwcp-tag[data-c="purple"] { background: #4a1d7a; color: #e9d5ff; }
  .fwc-tag[data-c="emerald"], .fwcp-tag[data-c="emerald"] { background: #0b4a3a; color: #a7f3d0; }
  .fwc-tag[data-c="slate"], .fwcp-tag[data-c="slate"] { background: #334155; color: #e2e8f0; }
}
.fwc-new, .fwcp-new { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: #fbbf24; color: #451a03; font-size: 9.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- floating button (bottom-right, directly above the WhatsApp button) ---------- */
body.fwc-on #waFab { bottom: max(1rem, env(safe-area-inset-bottom)) !important; right: max(1.5rem, env(safe-area-inset-right)) !important; }
@media (max-width: 767px) {
  body.fwc-on #waFab, #fwCircFab, #fwCircPanel { right: max(1rem, env(safe-area-inset-right)) !important; }
}
#fwCircFab {
  position: fixed; z-index: 38; right: max(1.5rem, env(safe-area-inset-right)); bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 60px);
  display: inline-flex; align-items: center; gap: .5rem; height: 48px; min-width: 48px; padding: 0 .9rem; justify-content: center;
  border: 0; border-radius: 999px; cursor: pointer; font: 700 13px/1 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--fwc-brand); color: var(--fwc-brand-ink); box-shadow: 0 10px 28px rgba(109, 40, 217, .38);
  transition: transform .18s ease, box-shadow .18s ease; -webkit-tap-highlight-color: transparent;
}
#fwCircFab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(109, 40, 217, .46); }
#fwCircFab:active { transform: scale(.96); }
#fwCircFab:focus-visible, #fwCircPanel .fwc-close:focus-visible, #fwCircPanel a:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
#fwCircFab .fwc-ico { font-size: 16px; }
#fwCircFab .fwc-label { display: none; }
@media (min-width: 640px) { #fwCircFab .fwc-label { display: inline; } }
#fwCircFab .fwc-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--fwc-bg); box-sizing: border-box; }
#fwCircFab .fwc-badge[hidden] { display: none; }

/* ---------- panel ---------- */
#fwCircPanel {
  position: fixed; z-index: 39; right: max(1.5rem, env(safe-area-inset-right)); bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 118px);
  width: min(380px, calc(100vw - 2rem)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--fwc-bg); color: var(--fwc-ink); border: 1px solid var(--fwc-line); border-radius: 20px; box-shadow: var(--fwc-shadow);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.98); transform-origin: 100% 100%;
  transition: opacity .18s ease, transform .22s ease, visibility 0s .22s;
}
#fwCircPanel.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .18s ease, transform .22s ease, visibility 0s; }
#fwCircPanel .fwc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--fwc-line); }
#fwCircPanel .fwc-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--fwc-brand); }
#fwCircPanel .fwc-title { font-size: 17px; font-weight: 800; line-height: 1.25; margin-top: 2px; }
#fwCircPanel .fwc-close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--fwc-bg2); color: var(--fwc-mute); cursor: pointer; }
#fwCircPanel .fwc-close:hover { color: var(--fwc-ink); }
#fwCircPanel .fwc-list { overflow-y: auto; overscroll-behavior: contain; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
#fwCircPanel .fwc-item { display: block; padding: 11px 12px; border-radius: 14px; border: 1px solid transparent; background: var(--fwc-bg2); color: inherit; text-decoration: none; min-width: 0; }
#fwCircPanel a.fwc-item:hover { border-color: var(--fwc-brand); }
#fwCircPanel .fwc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
#fwCircPanel .fwc-date { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--fwc-mute); }
#fwCircPanel .fwc-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
#fwCircPanel .fwc-desc { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--fwc-mute); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#fwCircPanel .fwc-state { padding: 26px 14px; text-align: center; font-size: 13px; color: var(--fwc-mute); }
#fwCircPanel .fwc-skel { height: 74px; border-radius: 14px; background: linear-gradient(90deg, var(--fwc-bg2), var(--fwc-line), var(--fwc-bg2)); background-size: 200% 100%; animation: fwcShim 1.2s linear infinite; }
@keyframes fwcShim { to { background-position: -200% 0; } }
#fwCircPanel .fwc-foot { padding: 10px 14px 14px; border-top: 1px solid var(--fwc-line); }
#fwCircPanel .fwc-all { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 12px; background: var(--fwc-brand); color: var(--fwc-brand-ink); font-size: 13px; font-weight: 700; text-decoration: none; }
#fwCircPanel .fwc-all:hover { filter: brightness(1.08); }
@media (prefers-reduced-motion: reduce) {
  #fwCircFab, #fwCircPanel { transition: none; }
  #fwCircPanel .fwc-skel { animation: none; }
}
@media print { #fwCircFab, #fwCircPanel { display: none !important; } }

/* ---------- /circulars page ---------- */
.fwcp-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.fwcp-hero { padding: 40px 0 22px; }
.fwcp-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--fwc-brand); }
.fwcp-dot { width: 9px; height: 9px; border-radius: 50%; background: #10b981; }
.fwcp-h1 { margin: 8px 0 8px; font-size: clamp(26px, 4.5vw, 40px); line-height: 1.15; font-weight: 800; color: var(--fwc-ink); font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; }
.fwcp-lead { margin: 0; max-width: 640px; color: var(--fwc-mute); font-size: 15px; line-height: 1.6; }
.fwcp-tools { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 18px; }
.fwcp-search { position: relative; max-width: 460px; }
.fwcp-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--fwc-mute); pointer-events: none; }
.fwcp-search input { width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px 0 40px; border-radius: 14px; border: 1px solid var(--fwc-line); background: var(--fwc-bg); color: var(--fwc-ink); font: 500 14px Inter, system-ui, sans-serif; }
.fwcp-search input:focus { outline: 3px solid rgba(139, 92, 246, .35); border-color: var(--fwc-brand); }
.fwcp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fwcp-chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--fwc-line); background: var(--fwc-bg); color: var(--fwc-ink); font: 700 12.5px Inter, system-ui, sans-serif; cursor: pointer; }
.fwcp-chip:hover { border-color: var(--fwc-brand); }
.fwcp-chip[aria-pressed="true"] { background: var(--fwc-brand); border-color: var(--fwc-brand); color: var(--fwc-brand-ink); }
.fwcp-chip:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.fwcp-count { font-size: 12.5px; color: var(--fwc-mute); font-weight: 600; }
.fwcp-grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding-bottom: 20px; }
@media (min-width: 700px) { .fwcp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .fwcp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fwcp-card { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 20px; border-radius: 18px; border: 1px solid var(--fwc-line); background: var(--fwc-bg); color: var(--fwc-ink); }
.fwcp-card:hover { border-color: var(--fwc-brand); box-shadow: 0 12px 30px -10px rgba(109, 40, 217, .25); }
.fwcp-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fwcp-date { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--fwc-mute); }
.fwcp-title { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
.fwcp-desc { margin: 8px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--fwc-mute); overflow-wrap: anywhere; }
.fwcp-link { display: inline-flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--fwc-line); color: var(--fwc-brand); font-size: 13px; font-weight: 700; text-decoration: none; }
.fwcp-link:hover { text-decoration: underline; }
.fwcp-nolink { padding-top: 12px; border-top: 1px solid var(--fwc-line); color: var(--fwc-mute); font-size: 12.5px; }
.fwcp-state { grid-column: 1 / -1; padding: 44px 16px; text-align: center; color: var(--fwc-mute); border: 1px dashed var(--fwc-line); border-radius: 18px; }
.fwcp-state i { display: block; font-size: 30px; margin-bottom: 10px; }
.fwcp-skel { height: 170px; border-radius: 18px; background: linear-gradient(90deg, var(--fwc-bg2), var(--fwc-line), var(--fwc-bg2)); background-size: 200% 100%; animation: fwcShim 1.2s linear infinite; }
.fwcp-more { display: flex; justify-content: center; padding: 4px 0 32px; }
.fwcp-more button { height: 44px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--fwc-line); background: var(--fwc-bg); color: var(--fwc-ink); font: 700 13px Inter, system-ui, sans-serif; cursor: pointer; }
.fwcp-more button:hover { border-color: var(--fwc-brand); }
.fwcp-wa { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 16px; border-radius: 12px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; font-size: 13px; font-weight: 700; text-decoration: none; }
@media (prefers-color-scheme: dark) { .fwcp-wa { background: #0b3a2e; color: #a7f3d0; border-color: #14634c; } }
@media (prefers-reduced-motion: reduce) { .fwcp-skel { animation: none; } }
