/* Admin-only live visitor monitor. No storefront styling. */
#wp-admin-bar-elenpriv-live-visitors .ab-item{cursor:pointer!important}
#wp-admin-bar-elenpriv-live-visitors .elenpriv-live-count{display:inline-block;min-width:18px;text-align:center;font-weight:700}
.elenpriv-live-panel{position:fixed;z-index:1000002;right:12px;top:44px;width:min(430px,calc(100vw - 24px));max-height:calc(100vh - 60px);background:#fff;border:1px solid #dedede;border-radius:16px;box-shadow:0 18px 54px rgba(0,0,0,.22);overflow:hidden;opacity:0;transform:translateY(-8px);pointer-events:none;transition:.16s ease;color:#202124;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
.elenpriv-live-panel.is-open{opacity:1;transform:none;pointer-events:auto}
.elenpriv-live-head{height:58px;padding:0 15px 0 18px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ececec;background:#fff}
.elenpriv-live-head>div{display:flex;align-items:center;gap:9px}.elenpriv-live-head strong{font-size:17px}.elenpriv-live-head-count{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;padding:0 7px;border-radius:13px;background:#eef3ff;color:#315be8;font-weight:700;font-size:13px}
.elenpriv-live-close{width:36px;height:36px;border:0!important;border-radius:50%!important;background:#f2f2f2!important;color:#222!important;font-size:26px!important;line-height:32px!important;padding:0!important;margin:0!important;cursor:pointer}
.elenpriv-live-body{overflow:auto;max-height:calc(100vh - 120px);overscroll-behavior:contain}.elenpriv-live-row{display:grid;grid-template-columns:42px 1fr;gap:11px;padding:14px 17px;border-bottom:1px solid #efefef;background:#fff}.elenpriv-live-row:last-child{border-bottom:0}
.elenpriv-live-avatar{width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#18233b;color:#fff;font-weight:700;font-size:14px}.elenpriv-live-info{min-width:0;display:flex;flex-direction:column;gap:3px;font-size:12px;color:#777;line-height:1.3}.elenpriv-live-name{font-size:14px;font-weight:700;color:#222;display:flex;gap:7px;align-items:center}.elenpriv-live-name em{font-style:normal;font-size:10px;font-weight:600;color:#548d61;background:#ecf6ed;border-radius:10px;padding:2px 6px}.elenpriv-live-page{display:block;color:#333;font-size:13px;font-weight:600;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.elenpriv-live-path{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.elenpriv-live-cart{color:#8a5b1b;font-weight:600}.elenpriv-live-empty{padding:28px 20px;text-align:center;color:#777}
.elenpriv-live-backdrop{display:none}.elenpriv-live-mobile-button{display:none!important}
@media(max-width:782px){
  #wp-admin-bar-elenpriv-live-visitors{display:none!important}
  .elenpriv-live-mobile-button{display:flex!important;position:fixed;z-index:1000000;right:12px;bottom:7px;height:38px;align-items:center;gap:7px;padding:0 13px!important;border:0!important;border-radius:20px!important;background:#18233b!important;color:#fff!important;font-size:13px!important;font-weight:600!important;line-height:38px!important;box-shadow:0 4px 16px rgba(0,0,0,.25);margin:0!important}
  .elenpriv-live-mobile-button b{display:inline-flex;align-items:center;justify-content:center;min-width:23px;height:23px;padding:0 6px;border-radius:12px;background:#fff;color:#18233b;font-size:12px}
  .elenpriv-live-backdrop{position:fixed;z-index:1000001;inset:0;background:rgba(0,0,0,.28);opacity:0;pointer-events:none;transition:.16s;display:block}.elenpriv-live-backdrop.is-open{opacity:1;pointer-events:auto}
  .elenpriv-live-panel{top:auto;right:0;left:0;bottom:0;width:100%;max-height:72vh;border-radius:18px 18px 0 0;border-left:0;border-right:0;border-bottom:0;transform:translateY(105%);opacity:1}.elenpriv-live-panel.is-open{transform:none}
  .elenpriv-live-body{max-height:calc(72vh - 58px);padding-bottom:max(8px,env(safe-area-inset-bottom))}
}

/* The private launcher stays visible on desktop, tablet and mobile. */
.elenpriv-live-mobile-button{display:flex!important;position:fixed;z-index:1000000;right:12px;bottom:max(10px,env(safe-area-inset-bottom));height:38px;align-items:center;gap:8px;padding:0 13px!important;border:0!important;border-radius:20px!important;background:#18233b!important;color:#fff!important;font-size:13px!important;font-weight:600!important;line-height:38px!important;box-shadow:0 4px 16px #0003;margin:0!important;cursor:pointer}
.elenpriv-live-mobile-button b{display:inline-flex;align-items:center;justify-content:center;min-width:23px;height:23px;padding:0 6px;border-radius:12px;background:#fff;color:#18233b;font-size:12px}
.elenpriv-navigation-panel .elenpriv-admin-menu-item{display:none!important}
@media(min-width:783px){.elenpriv-live-panel{top:auto;bottom:60px;max-height:min(70vh,650px)}.elenpriv-live-body{max-height:calc(min(70vh,650px) - 58px)}}
.elenpriv-live-mobile-button:focus-visible,.elenpriv-live-close:focus-visible{outline:2px solid #d86f49!important;outline-offset:3px}
@media(prefers-reduced-motion:reduce){.elenpriv-live-panel,.elenpriv-live-backdrop{transition:none}}

.elenpriv-live-geo-credit{padding:8px 16px;text-align:right;font-size:10px;color:#777}.elenpriv-live-geo-credit a{color:inherit;text-decoration:none}

/* Match the storefront header shortcuts and keep the count inside the touch target. */
body.elenpriv-store .elenpriv-header-actions .elenpriv-live-header-button {
  order: 3 !important;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: #ddd;
  cursor: pointer;
}

.elenpriv-live-header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.elenpriv-live-header-icon .elenpriv-live-count {
  position: absolute;
  inset-block-start: -1px;
  inset-inline-end: -5px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: #d97043;
  color: #fff;
  font: 700 10px/1 Arial, sans-serif;
}

/* The panel stays below the header on desktop and fills the mobile viewport. */
.elenpriv-live-panel.is-header-panel {
  --ep-live-panel-inset: calc(var(--ep-live-panel-top, 68px) + 8px);
  top: var(--ep-live-panel-inset);
  bottom: auto;
  display: flex;
  flex-direction: column;
  max-height: min(650px, calc(100vh - var(--ep-live-panel-inset) - max(8px, env(safe-area-inset-bottom))));
  max-height: min(650px, calc(100dvh - var(--ep-live-panel-inset) - max(8px, env(safe-area-inset-bottom))));
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease;
}

.elenpriv-live-panel.is-header-panel.is-open {
  transform: none;
  opacity: 1;
}

.elenpriv-live-panel.is-header-panel .elenpriv-live-head {
  flex: 0 0 58px;
}

.elenpriv-live-panel.is-header-panel .elenpriv-live-body {
  min-height: 0;
  max-height: none;
  padding-bottom: 0;
}

@media (max-width: 849px) {
  html body.elenpriv-store.logged-in #page .elenpriv-header-actions .elenpriv-live-header-icon > svg {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
  }
}

@media (max-width: 782px) {
  html:has(.elenpriv-live-panel.is-header-panel.is-open),
  body:has(.elenpriv-live-panel.is-header-panel.is-open) {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .elenpriv-live-panel.is-header-panel {
    inset: 0;
    width: auto;
    height: 100%;
    height: 100dvh;
    max-height: none;
    box-sizing: border-box;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .elenpriv-live-panel.is-header-panel .elenpriv-live-head {
    box-sizing: border-box;
    height: auto;
    flex-basis: calc(58px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: max(18px, env(safe-area-inset-left, 0px));
    padding-right: max(15px, env(safe-area-inset-right, 0px));
  }

  .elenpriv-live-panel.is-header-panel .elenpriv-live-body {
    flex: 1 1 auto;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .elenpriv-live-panel.is-header-panel { transition: none; }
}
