/* assets/widget.css (EVERSIGN Contact Hub v1.2.4)
   - Ring bug eliminated (focus-visible only + theme override guards)
   - Premium FAB halo (no random ring)
   - Tighter green wash
   - Improved Join CTA
   - Scrollbar styling
   - Safe scoped reset (theme-proof)
*/
.es-v88{
  --g:#16a34a;
  --g2:#22c55e;
  --ink:#0b1220;
  --es-ink-1: rgba(8, 15, 28, .92);
  --es-ink-2: rgba(8, 15, 28, .72);
  --es-ink-3: rgba(8, 15, 28, .52);
  --r1:22px;
  --r2:18px;
}

/* ---------------------------
   SAFE SCOPED RESET (theme-proof)
---------------------------- */
.es-v88, .es-v88 *{
  box-sizing: border-box !important;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}
.es-v88 a{ color: inherit !important; }
.es-v88 button{
  background-image: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

/* Z */
.es-v88, .es88-panel, .es88-fab, .es88-teaser{ z-index: 2147483647 !important; }
.es88-backdrop{ z-index: 2147483646 !important; }

/* Root */
.es-v88{
  position: fixed;
  /* Theme-safe positioning via vars */
  --es-offx: 0px;
  --es-offy: 0px;
  --es-z: 2147483647;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + var(--es-offy));
  right: calc(18px + var(--es-offx));
  left: auto;
  z-index: var(--es-z);
}
.es-v88[data-side="left"]{
  left: calc(18px + var(--es-offx));
  right: auto;
}
.es-v88[data-side="right"]{
  right: calc(18px + var(--es-offx));
  left: auto;
  z-index: var(--es-z);
}

/* ---------------------------
   FAB
---------------------------- */
.es88-fab{
  width:60px;height:60px;border-radius:999px;border:0 !important;
  /* Solid, premium FAB (avoid washed/ghost look caused by large glow layers). */
  background-color: var(--g) !important;
  background-image: radial-gradient(120% 120% at 30% 20%, #2eea7b 0%, #1bcf64 35%, #0f8f3e 100%) !important;
  color:#fff; cursor:pointer;
  box-shadow:
    0 28px 90px rgba(0,0,0,.22),
    0 12px 26px rgba(0,0,0,.14),
    0 0 0 4px rgba(37, 211, 102, .16) !important;
  display:grid;place-items:center;
  position:relative;
  transition: transform .14s ease, filter .14s ease;
  outline: none !important;
  isolation: isolate;
}
.es88-fab:hover{ transform: translateY(-1px); filter:saturate(1.06); }
.es88-fab:active{ transform: translateY(0px); }

/* Ring bug eliminated:
   - no focus ring for mouse
   - ring only on keyboard (focus-visible)
   - theme focus box-shadow disabled
*/
.es88-fab:focus{ outline:none !important; box-shadow: 0 28px 90px rgba(0,0,0,.22), 0 12px 26px rgba(0,0,0,.14) !important; }
.es88-fab:focus-visible{
  outline: 2px solid rgba(34,197,94,.55) !important;
  outline-offset: 4px !important;
}

/* Glow layers were causing the "washed" FAB look on some themes/browsers.
   Keep the FAB premium using box-shadow only. */
.es88-fabHalo,
.es88-fabGlow{ display:none !important; }

.es88-fabIcon{
  width:26px;height:26px;
  position:absolute;
  transition: opacity .14s ease, transform .14s ease;
}
.es88-fabIcon svg{
  width:100%; height:100%; display:block;
  color:#fff; fill: currentColor;
}
.es88-fabIcon svg *{ stroke: currentColor; }
.es88-iClose{ opacity:0; transform: scale(.92); }
.es88-fab.is-open .es88-iChat{ opacity:0; transform: scale(.92); }
.es88-fab.is-open .es88-iClose{ opacity:1; transform: scale(1.08); }

/* Teaser */
.es88-teaser{
  position:absolute;
  right:70px;
  bottom:10px;
  max-width:220px;
  padding:10px 12px;
  border-radius:14px;
  background:#fff;
  border:1px solid rgba(11,18,32,.10);
  box-shadow: 0 14px 34px rgba(0,0,0,.14);
  font-size:12.5px;
  color: var(--es-ink-1);
  cursor:pointer;
  animation: esTeaseIn .18s ease-out;
}
.es88-teaser strong{ display:block; font-weight:820; }
.es88-teaser span{ display:block; margin-top:2px; color: var(--es-ink-2); }
@keyframes esTeaseIn{ from{ opacity:0; transform: translateY(6px);} to{opacity:1; transform:none;} }
@media (max-width:480px){ .es88-teaser{ display:none; } }

/* Backdrop (dim outside only) */
.es88-backdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.06);
}

/* Ensure panel is never blurred by theme */
.es88-panel, .es88-panel *{
  filter:none !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}

/* Panel */
.es88-panel{
  position:absolute;
  right:0;
  bottom:78px;
  width:392px;
  max-width: calc(100vw - 32px);
  border-radius: var(--r1);
  overflow:hidden;
  background: rgba(250,250,250,.97);
  border: 1px solid rgba(255,255,255,.72);
  outline: 1px solid rgba(11,18,32,.08);
  outline-offset:-1px;
  box-shadow:
    0 40px 120px rgba(0,0,0,.28),
    0 10px 30px rgba(0,0,0,.14),
    0 1px 0 rgba(255,255,255,.82) inset;
  opacity:0;
  transform: translateY(14px) scale(.97);
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  max-height: min(610px, calc(100vh - 130px));
  display:flex;
  flex-direction:column;
}
.es88-panel.open{ opacity:1; transform:none; pointer-events:auto; }

.es88-head{
  padding:18px 18px 14px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  border-bottom:1px solid rgba(11,18,32,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(250,250,250,.97));
}
.es88-title{ font-weight:880; font-size:17px; color: var(--es-ink-1); letter-spacing:-.01em; }
.es88-sub{ margin-top:5px; font-size:12.5px; font-weight:650; color: var(--es-ink-2); }

.es88-headRight{ display:flex; align-items:center; gap:10px; }
.es88-chip{
  font-size:11px; font-weight:850;
  padding:6px 10px; border-radius:999px;
  color: rgba(6,95,70,.95);
  background: rgba(34,197,94,.10);
  border: 1px solid rgba(34,197,94,.18);
}
.es88-close{
  width:38px;height:38px;border-radius:14px;
  border:1px solid rgba(11,18,32,.10) !important;
  background: rgba(255,255,255,.92) !important;
  color:rgba(11,18,32,.72);
  font-size:18px; cursor:pointer;
  display:grid; place-items:center;
  outline:none !important;
}
.es88-close:focus-visible{ outline:2px solid rgba(34,197,94,.55) !important; outline-offset:2px !important; }

.es88-body{
  padding:16px 16px 14px;
  display:grid;
  gap:12px;
  overflow:auto;
  background: linear-gradient(180deg, rgba(246,248,250,.96), rgba(255,255,255,.98));
}

/* Scrollbar styling */
.es88-body{ scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.18) transparent; }
.es88-body::-webkit-scrollbar{ width: 10px; }
.es88-body::-webkit-scrollbar-track{ background: transparent; }
.es88-body::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.14);
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.85);
}

/* Interaction */
.es88-hero, .es88-tile, .es88-insider{
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .10s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.es88-hero:active, .es88-tile:active, .es88-insider:active{ transform: translateY(1px); }

@media (hover:hover){
  .es88-hero:hover, .es88-tile:hover, .es88-insider:hover{ transform: translateY(-2px); }
  .es88-insider:hover .es88-go{ transform: translateX(3px); transition: transform .16s ease; }
  .es88-insider:hover .es88-join{ transform: translateY(-1px); }
}
.es88-hero:focus-visible,
.es88-tile:focus-visible,
.es88-insider:focus-visible{
  outline: 2px solid rgba(34,197,94,.60) !important;
  outline-offset: 2px !important;
}

/* Hero (tighter green wash) */
.es88-hero{
  text-decoration:none;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px;
  border-radius: var(--r2);
  border:1px solid rgba(34,197,94,.18);
  background:#fff;
  box-shadow:
    0 10px 20px rgba(34,197,94,.06),
    0 8px 18px rgba(0,0,0,.045);
}
.es88-heroLeft{ display:flex; align-items:center; gap:12px; min-width:0; }
.es88-heroIcon{
  width:44px;height:44px;border-radius:16px;
  display:grid; place-items:center;
  color:#0f5132;
  background: rgba(34,197,94,.14);
  border: 1px solid rgba(34,197,94,.22);
}
.es88-heroIcon svg{ width:22px;height:22px; }
.es88-heroTitle{ font-size:14px; font-weight:820; color: var(--es-ink-1); letter-spacing:-.01em; }
.es88-heroMeta{ margin-top:3px; font-size:12.5px; font-weight:700; color: var(--es-ink-2); }

.es88-cta{
  font-size:12.5px; font-weight:900;
  padding:10px 14px;border-radius:999px;color:#fff;
  background: linear-gradient(135deg, var(--g2), var(--g)) !important;
  box-shadow: 0 10px 22px rgba(22,163,74,.22), 0 0 0 6px rgba(34,197,94,.08) !important;
}
.es88-cta.pulse{ animation: ctaPulse .6s ease-out 1; }
@keyframes ctaPulse{
  0%{ box-shadow: 0 10px 22px rgba(22,163,74,.22), 0 0 0 0 rgba(34,197,94,.22); }
  100%{ box-shadow: 0 10px 22px rgba(22,163,74,.22), 0 0 0 16px rgba(34,197,94,0); }
}

/* Tiles */
.es88-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.es88-tile{
  text-decoration:none;
  padding:14px;border-radius:16px;
  border:1px solid rgba(11,18,32,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94));
  box-shadow: 0 10px 22px rgba(0,0,0,.045);
  display:flex; gap:10px; align-items:center;
}
.es88-tileIcon{
  width:38px;height:38px;border-radius:14px;
  display:grid;place-items:center;
  background: rgba(11,18,32,.04);
  border: 1px solid rgba(11,18,32,.08);
  color: rgba(11,18,32,.78);
}
.es88-tileIcon svg{ width:18px;height:18px; }
.es88-tileTitle{ font-weight:820; font-size:13.3px; color: var(--es-ink-1); letter-spacing:-.01em; }
.es88-tileMeta{ margin-top:3px; font-weight:700; font-size:12.5px; color: var(--es-ink-2); }

/* Insider */
.es88-insider{
  text-decoration:none;
  padding:14px 14px 12px;
  border-radius: var(--r2);
  border:1px dashed rgba(34,197,94,.22);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.94));
  box-shadow: 0 10px 22px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.85) inset;
}
.es88-insiderTop{ display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.es88-insiderTitle{ font-weight:820; font-size:13.6px; color: var(--es-ink-1); letter-spacing:-.01em; }

.es88-pill{
  margin-left:8px;
  font-size:10.8px; font-weight:900;
  padding:4px 8px;border-radius:999px;
  color: rgba(6,95,70,.92);
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.14);
}
.es88-pill-new{
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.22);
  color:#0f5132;
}
.es88-insiderMeta{ margin-top:3px; font-weight:700; font-size:12.5px; color: var(--es-ink-2); }

.es88-insiderRight{ display:flex; align-items:center; gap:10px; flex-shrink:0; }

/* Improved Join CTA styling */
.es88-join{
  display:inline-flex; align-items:center; justify-content:center;
  height:32px; padding:0 14px; border-radius:999px;
  font-size:12px; font-weight:950;
  color:#0f5132;
  background: linear-gradient(180deg, rgba(34,197,94,.18), rgba(34,197,94,.08));
  border: 1px solid rgba(34,197,94,.30);
  box-shadow: 0 12px 24px rgba(22,163,74,.10);
}
.es88-insider:hover .es88-join{
  background: linear-gradient(180deg, rgba(34,197,94,.24), rgba(34,197,94,.10));
  border-color: rgba(34,197,94,.36);
}
.es88-go{ font-size:18px; color: rgba(11,18,32,.38); }
.es88-insider:hover .es88-go{ color: rgba(11,18,32,.55); }

.es88-insiderHint{ margin-top:8px; font-size:12px; font-weight:680; color: var(--es-ink-3); }
.es88-foot{ text-align:center; font-size:11px; font-weight:700; color: var(--es-ink-3); padding-top:2px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .es88-panel, .es88-hero, .es88-tile, .es88-insider,
  .es88-fab, .es88-fabIcon{ transition:none !important; }
  .es88-cta.pulse{ animation:none !important; }
}
@media (max-width: 480px){
  .es-v88{ right:14px; bottom:max(14px, env(safe-area-inset-bottom)); }
  .es88-panel{ width:360px; }
}
