/* ============================================================
   LEAD LOGIC — App bottom nav  (mirrors pulse-bottomnav)
   Bottom tab bar + center ＋ FAB + create bottom-sheet.
   Shows when:  html.pulse-app  (inside the app / ?app=1 / PWA)
                OR  screen <= 768px  (phone browser)
   Desktop web is completely untouched.
   ============================================================ */

.pulse-tabbar{ display:none; }
.pulse-fab{ display:none; }

/* ---- visual styling (only rendered when tabbar is shown) ---- */
.pulse-tabbar{
  position:fixed; left:0; right:0; bottom:0; z-index:1000;
  align-items:center; justify-content:space-around;
  height:calc(62px + env(safe-area-inset-bottom,0px));
  padding:0 6px env(safe-area-inset-bottom,0px);
  background:var(--surface,#fff); border-top:1px solid var(--border,#ECEEF4);
  box-shadow:0 -2px 16px -8px rgba(13,19,32,.18);
}
.pulse-tab{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:3px; height:62px; color:var(--muted,#9AA2B1); font-size:10.5px; font-weight:600;
  text-decoration:none; border:none; background:none; cursor:pointer;
  -webkit-tap-highlight-color:transparent; font-family:inherit;
}
.pulse-tab svg{ width:23px; height:23px; stroke-width:1.9; fill:none; stroke:currentColor; }
.pulse-tab.active{ color:var(--primary,#6D5EFC); }
.pulse-tab:active{ opacity:.6; }
.pulse-tab-spacer{ visibility:hidden; }

.pulse-fab{
  position:fixed; bottom:calc(20px + env(safe-area-inset-bottom,0px));
  left:50%; transform:translateX(-50%); z-index:1001;
  width:56px; height:56px; border-radius:19px;
  background:linear-gradient(135deg, var(--primary,#7C6BFF), #5B49E0);
  box-shadow:0 10px 22px -6px rgba(124,107,255,.6);
  align-items:center; justify-content:center;
  color:#fff; border:4px solid var(--bg,#F4F6FB); text-decoration:none;
}
.pulse-fab svg{ width:26px; height:26px; stroke:#fff; fill:none; stroke-width:2.4; transition:transform .22s ease; }
.pulse-fab.open{ transform:translateX(-50%) rotate(45deg); }

.pulse-sheet-backdrop{
  position:fixed; inset:0; z-index:1002; background:rgba(13,19,32,.45);
  opacity:0; visibility:hidden; transition:opacity .2s;
}
.pulse-sheet-backdrop.open{ opacity:1; visibility:visible; }
.pulse-sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:1003;
  background:var(--surface,#fff); border-radius:20px 20px 0 0;
  padding:10px 16px calc(18px + env(safe-area-inset-bottom,0px));
  transform:translateY(110%); transition:transform .26s cubic-bezier(.4,0,.2,1);
  box-shadow:0 -8px 30px rgba(13,19,32,.2);
}
.pulse-sheet.open{ transform:translateY(0); }
.pulse-sheet-grip{ width:38px; height:4px; border-radius:3px; background:var(--border,#E0E3EC); margin:4px auto 12px; }
.pulse-sheet-item{
  display:flex; align-items:center; gap:13px; padding:13px 6px;
  font-size:15px; font-weight:500; color:var(--text,#0D1320); text-decoration:none;
  border-bottom:1px solid var(--border,#F3F4F8);
}
.pulse-sheet-item:last-child{ border-bottom:none; }
.psi-ic{ width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.psi-ic svg{ width:20px; height:20px; }
.psi-ic.lead{ background:#EEEBFF; color:#5B49E0; }
.psi-ic.call{ background:#E6F6EE; color:#15A36B; }
.psi-ic.meet{ background:#E3F7F3; color:#1FB6A2; }

/* ---- triggers: show the bar ---- */
html.pulse-app .pulse-tabbar,
html.pulse-app .pulse-fab{ display:flex; }
html.pulse-app .main{ padding-bottom:96px !important; }
html.pulse-app .mobile-menu-btn{ display:none !important; }
html.pulse-app #aiFab{ bottom:calc(86px + env(safe-area-inset-bottom,0px)) !important; }

@media (max-width:768px){
  .pulse-tabbar, .pulse-fab{ display:flex; }
  .main{ padding-bottom:96px !important; }
  #aiFab{ bottom:86px !important; }
}
