/* ============================================================
   NAV - GENERAL STYLES
   ============================================================ */

/* Profile avatar next to Live tab */
.lfl-live-nav { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; }
#liveLink { display: inline-flex; align-items: center; gap: 5px; }
.top-link.lfl-nav-voice-link {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; width: 27px; height: 27px; min-width: 27px;
  padding: 0; border: 1px solid var(--lfl-border, #818b96); border-radius: 50%;
  background: var(--lfl-surface-hover, #424c57); color: var(--lfl-text, #fff); font-size: 18px; line-height: 1;
}
.top-link.lfl-nav-voice-link[hidden] { display: none !important; }
.top-link.lfl-nav-voice-link { margin-left: 0; }
.top-link.lfl-nav-voice-link:focus-visible { outline: 2px solid var(--lfl-blue-border, #65b2ff); outline-offset: 3px; }

.profile-link {
  display: flex;
  align-items: center;
  margin-right: 10px;
  text-decoration: none;
  position: relative;
}

.profile-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--lfl-surface, #ffffff);
  flex-shrink: 0;
  border: 2px solid var(--lfl-border, #ffffff);   /* default = offline gray */
}

/* OFFLINE = gray border */
.profile-circle.offline { border-color: var(--lfl-border, #ffffff); }

/* ONLINE = your electric blue */
.profile-circle.online { border-color: var(--lfl-blue-border, #04aaff); }

/* Stream Day/config health overrides the ordinary live/offline ring. */
.profile-circle.activation-inactive,
.profile-circle.activation-config-error {
  border-color: var(--lfl-red-border, #ff3f4f) !important;
  box-shadow: 0 0 0 2px rgba(255, 63, 79, 0.22), 0 0 12px rgba(255, 63, 79, 0.8);
}

.lfl-activation-badge {
  position: absolute;
  left: -7px;
  top: -7px;
  z-index: 2;
  min-width: 21px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--lfl-red-border, #ff7b86);
  border-radius: 999px;
  background: var(--lfl-red-solid, #9d101d);
  color: var(--lfl-on-accent, #fff);
  font: 700 10px/17px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 0 9px rgba(255, 63, 79, 0.75);
}

.lfl-activation-badge[hidden] {
  display: none !important;
}

.lfl-notification-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  margin-left: 7px;
  margin-right: 4px;
  padding: 0;
  border: 1px solid var(--lfl-border, rgba(255,255,255,.18));
  border-radius: 999px;
  background: var(--lfl-wash, rgba(255,255,255,.035));
  color: var(--lfl-text, #fff);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.lfl-owner-notification-menu[hidden] {
  display: none !important;
}

.lfl-owner-notification-menu .lfl-notification-link::after {
  display: none;
}

.lfl-notification-link:hover,
.lfl-notification-link:focus-visible {
  border-color: var(--lfl-blue-border, rgba(77, 162, 255, .75));
  background: var(--lfl-blue-wash, rgba(42, 129, 219, .16));
}

.lfl-notification-link.has-unread {
  border-color: var(--lfl-blue-border, #4aa4ff);
  box-shadow: 0 0 0 2px rgba(51, 148, 255, .14), 0 0 12px rgba(51, 148, 255, .55);
}

.lfl-notification-link.has-health-unread:not(.has-activity-unread) {
  border-color: var(--lfl-red-border, #ff5362);
  box-shadow: 0 0 0 2px rgba(255, 83, 98, .14), 0 0 12px rgba(255, 63, 79, .55);
}

.lfl-notification-link.has-error {
  border-color: var(--lfl-red-border, #ff5362);
  box-shadow: 0 0 10px rgba(255, 63, 79, .55);
}

.lfl-notification-link[hidden] {
  display: none !important;
}

[data-lfl-owner-notifications][hidden],
[data-lfl-owner-workspace][hidden],
[data-lfl-owner-workspace-page][hidden] {
  display: none !important;
}

.lfl-owner-workspace-notice {
  max-width: 680px;
  margin: 100px auto;
  padding: 24px;
  border: 1px solid var(--lfl-border, #444);
  border-radius: 14px;
  background: var(--lfl-surface, #191919);
  color: var(--lfl-text, #eee);
}
.lfl-owner-workspace-notice a { display: inline-block; margin: 8px 20px 0 0; color: var(--lfl-blue-text, #8fc9ff); }

.lfl-notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--lfl-blue-border, #8fc8ff);
  border-radius: 999px;
  background: var(--lfl-blue-solid, #1168b7);
  color: var(--lfl-on-accent, #fff);
  font: 800 10px/1 system-ui, sans-serif;
  box-shadow: 0 0 8px rgba(47, 151, 255, .7);
}

.lfl-notification-badge--activity {
  top: -8px;
  right: -8px;
}

.lfl-notification-badge--health {
  top: -8px;
  right: auto;
  left: -8px;
  border-color: var(--lfl-red-border, #ff929d);
  background: var(--lfl-red-solid, #b91d2c);
  box-shadow: 0 0 8px rgba(255, 63, 79, .72);
}

.lfl-notification-badge--email {
  top: auto;
  right: auto;
  bottom: -8px;
  left: -8px;
  border-color: var(--lfl-purple-border, #ff9fd1);
  background: var(--lfl-purple-solid, #a91b68);
  box-shadow: 0 0 8px rgba(255, 72, 167, .72);
}

.lfl-notification-badge[hidden] {
  display: none !important;
}

.lfl-owner-notification-menu-list a,
#lflDockOwnerNotificationMenu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.lfl-notification-section-count {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 2px 6px;
  border: 1px solid var(--lfl-blue-border, #79baff);
  border-radius: 999px;
  background: var(--lfl-blue-solid, #1168b7);
  color: var(--lfl-on-accent, #fff);
  font: 800 10px/1.35 system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 0 7px rgba(47,151,255,.45);
}

.lfl-notification-section-count[hidden] {
  display: none !important;
}

.lfl-notification-section-count[data-notification-section-count="health"] {
  border-color: var(--lfl-red-border, #ff929d);
  background: var(--lfl-red-solid, #b91d2c);
  box-shadow: 0 0 7px rgba(255, 63, 79, .48);
}

.lfl-notification-section-count[data-notification-section-count="email"] {
  border-color: var(--lfl-purple-border, #ff9fd1);
  background: var(--lfl-purple-solid, #a91b68);
  box-shadow: 0 0 7px rgba(255, 72, 167, .48);
}

a.zap-icon.zap-unavailable {
  background: transparent !important;
}

.stats-box--zap.zap-unavailable-wrap {
  border-color: var(--lfl-red-border, #ff3f4f) !important;
  box-shadow: 0 0 0 2px rgba(255, 63, 79, 0.22), 0 0 12px rgba(255, 63, 79, 0.8);
}

.profile-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Viewer avatar: a bit smaller + blue border */
.viewer-profile {
  width: 32px;
  height: 32px;
  border: 2px solid var(--lfl-border, #ffffff);
}

.viewer-profile-menu {
  align-items: center;
  padding: 6px 10px 12px;
  margin: -6px -10px -12px;
}

/* Keep a narrow downward path into each menu without letting its hover target
   spill sideways over the neighboring navigation buttons. */
@media (min-width: 721px) {
  /* Notepad and Nostr are semantic buttons. Match the horizontal spacing
     they had when these desktop triggers were links. */
  .nav-extras > .nav-dd:not(.viewer-profile-menu) > .top-link {
    margin: 0 8px;
  }

  .lfl-owner-notification-menu {
    padding-right: 0;
    padding-left: 0;
    margin-right: 4px;
    margin-left: 8px;
  }

  .lfl-owner-notification-menu .lfl-notification-link {
    margin-right: 0;
    margin-left: 0;
  }

  .viewer-profile-menu {
    padding-right: 0;
    padding-left: 0;
    margin-right: 0;
    margin-left: 10px;
  }

  #adminLink {
    margin-left: 16px;
  }

  /* Bell/avatar triggers are narrow. Nudge only their floating menus about 10%
     farther right so an ordinary diagonal pointer path lands inside the panel
     instead of crossing its left edge. Larger nav dropdowns keep right: 0. */
  .nav-dd.viewer-profile-menu .viewer-profile-menu-list,
  .lfl-owner-notification-menu .lfl-owner-notification-menu-list {
    right: -18px;
  }

  .viewer-profile-menu::before {
    position: absolute;
    top: 100%;
    right: -4px;
    width: 46px;
    height: 10px;
    content: "";
  }

  .lfl-owner-notification-menu::before {
    position: absolute;
    top: 100%;
    right: -4px;
    width: 43px;
    height: 10px;
    content: "";
  }

  /* These two tiny controls should not open while the pointer is merely
     crossing the nav toward Live or Nostr. Click and keyboard opening remain
     immediate; pointer hover receives only a brief intentionality delay. */
  .nav-dd.viewer-profile-menu .viewer-profile-menu-list,
  .lfl-owner-notification-menu .lfl-owner-notification-menu-list {
    display: flex !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .06s ease, visibility 0s linear .06s;
  }

  .nav-dd.viewer-profile-menu.lfl-hover-grace-open .viewer-profile-menu-list,
  .lfl-owner-notification-menu:hover .lfl-owner-notification-menu-list,
  .lfl-owner-notification-menu.lfl-hover-grace-open .lfl-owner-notification-menu-list {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: .12s;
  }

  /* Once the hover-intent timer has opened one of these tiny menus, do not
     re-apply the fade delay while the pointer crosses the diagonal grace gap. */
  .nav-dd.viewer-profile-menu.lfl-hover-grace-open .viewer-profile-menu-list,
  .lfl-owner-notification-menu.lfl-hover-grace-open .lfl-owner-notification-menu-list {
    transition-delay: 0s;
  }

  .nav-dd.viewer-profile-menu:focus-within .viewer-profile-menu-list,
  .nav-dd.viewer-profile-menu.open .viewer-profile-menu-list,
  .lfl-owner-notification-menu:focus-within .lfl-owner-notification-menu-list,
  .lfl-owner-notification-menu.open .lfl-owner-notification-menu-list {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0s;
  }
}

.viewer-profile-trigger {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.viewer-profile-trigger::after {
  display: none;
}

.viewer-profile-trigger:focus-visible {
  outline: 2px solid var(--lfl-blue-border, #5ea7eb);
  outline-offset: 3px;
}

.viewer-profile-menu-list {
  min-width: 135px;
}

/* The mobile/hamburger profile picker remains tap-controlled. */
.nav-dd.viewer-profile-menu .viewer-profile-menu-list {
  display: none !important;
}

.nav-dd.viewer-profile-menu.open .viewer-profile-menu-list {
  display: flex !important;
}

/* Desktop viewer-avatar hover is controlled only by the JavaScript intent/grace
   state. Keyboard focus remains immediate. This avoids CSS :hover hiding and
   reopening the menu while a diagonal pointer crosses the trigger/menu gap. */
@media (min-width: 721px) {
  .nav-dd.viewer-profile-menu.lfl-hover-grace-open .viewer-profile-menu-list,
  .nav-dd.viewer-profile-menu:focus-within .viewer-profile-menu-list {
    display: flex !important;
  }
}

/* HOME BUTTON: always locked to left */
#mainSiteLink {
  order: -1 !important;
  margin-right: 8px;
  flex-shrink: 0;
}

/* Make the bar a positioning anchor */
.top-bar {
  position: relative;
  z-index: 5000; /* Ensure nav stays on top */
}

.top-bar-inner {
  padding-right: 62px; /* Space for the Desktop Resources Dot */
}

/* The Right Side Container */
.top-right {
  display: flex;
  align-items: center;
}

/* ============================================================
   NAV EXTRAS & HAMBURGER (The New Logic)
   ============================================================ */

/* 1. Mobile Menu Button - Hidden on Desktop */
.mobile-menu-btn {
  display: none; 
}

/* 2. Nav Extras - Default Desktop View (Row) */
.nav-extras {
  display: flex;
  align-items: center;
}

/* 3. Resources Dot - Desktop Position */
.nav-more {
  position: absolute;
  right: 25px; /* Moved left as requested so it's not on the edge */
  top: 50%;
  transform: translateY(-50%);
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 8px;
  color: var(--lfl-muted, #bbb);
  background-color: var(--lfl-surface-soft, #1e1e1e);

}

.nav-more-label {
  display: none;
}

/* ============================================================
   LOGIN AREA STYLES
   ============================================================ */
.top-login-area,
.nav-login-area {
  display: flex;
  align-items: center;
  margin-left: 18px;
  margin-right: 17px;

}

/* Logged-out button */
.nav-login-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--lfl-border, rgba(255, 255, 255, 0.25));
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Logged-in pill */
.nav-login-pill {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--lfl-border, rgba(255, 255, 255, 0.25));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  margin-left: 8px;
}

/* Expand the desktop hover target without making the small round control look
   larger. This makes the connect menu easier to reach with an imperfect mouse
   movement. */
.nav-login-pill::before {
  content: "";
  position: absolute;
  inset: -7px;
}

.nav-login-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* Logout Dropdown */
.nav-login-menu {
  position: absolute;
  /* Keep the desktop menu touching its parent so the pointer can travel from
     the round login button into the menu without crossing a hover dead zone. */
  top: 100%;
  right: 0;
  background: var(--lfl-surface, #111);
  border-radius: 8px;
  border: 1px solid var(--lfl-border, rgba(255, 255, 255, 0.15));
  padding: 6px 0;
  min-width: 260px;
  z-index: 1000;
}

/* Invisible bridge over the diagonal space between the tiny control and the
   full-width menu. The JavaScript grace timer provides an additional buffer. */
.nav-login-menu::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: -10px;
  height: 14px;
}

.nav-login-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--lfl-text, #fff);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.nav-login-menu button:hover { background: var(--lfl-wash, rgba(255, 255, 255, 0.08)); }

.nav-login-provider-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 55px;
  padding: 2px 5px;
  border: 1px solid var(--lfl-border, rgba(255, 255, 255, .32));
  border-radius: 999px;
  box-sizing: border-box;
}

.nav-login-provider-badge.is-ready,
.nav-login-provider-badge.is-missing {
  background: var(--lfl-wash, rgba(255, 255, 255, .09));
  border-color: var(--lfl-border, rgba(255, 255, 255, .34));
}

.nav-login-provider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: var(--lfl-surface, #f3f4f6);
  font-size: 18px;
  line-height: 1;
}

.nav-login-provider-state {
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 5px currentColor;
}

.nav-login-provider-badge.is-ready .nav-login-provider-state {
  color: var(--lfl-green-text, #3ee47b);
}

.nav-login-provider-badge.is-missing .nav-login-provider-state {
  color: var(--lfl-red-text, #ff4d5f);
}

.nav-login-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 54px;
  height: 28px;
  flex: 0 0 54px;
  border: 1px solid var(--lfl-border, rgba(255, 255, 255, .28));
  border-radius: 999px;
  background: var(--lfl-surface, #f3f4f6);
  box-sizing: border-box;
  font-size: 18px;
  line-height: 1;
}

.nav-login-action-separator {
  height: 1px;
  margin: 9px 12px;
  background: var(--lfl-wash-strong, rgba(255, 255, 255, .22));
}


/* ============================================================
   NAV DROPDOWNS (Notes / Media / Nostr) - DESKTOP
   ============================================================ */
.nav-dd {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: -10px;
}

.nav-dd-trigger::after {
  content: "▾";
  margin-left: 6px;
  font-size: 12px;
  opacity: 0.7;
}

.nav-dd-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 190px;
  display: none; /* Hidden by default */
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
  z-index: 9999;
  background: var(--lfl-surface, rgba(20,20,20,0.95));
  border: 1px solid var(--lfl-border, rgba(255,255,255,0.08));
  box-shadow: 0 10px 30px var(--lfl-shadow, rgba(0,0,0,0.35));
  backdrop-filter: blur(10px);
}

/* Desktop Hover: Show menu */
.nav-dd:hover .nav-dd-menu,
.nav-dd:focus-within .nav-dd-menu,
.nav-dd.open .nav-dd-menu {
  display: flex;
}

.nav-sub {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
}
.viewer-profile-menu-list > [hidden] {
  display: none !important;
}
.nav-sub:hover { background: var(--lfl-wash, rgba(255,255,255,0.08)); }

.nav-menu-group {
  display: grid;
  gap: 2px;
}

.nav-menu-group:not([hidden]) + .nav-menu-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--lfl-border, rgba(255,255,255,0.08));
}

.nav-menu-group-title {
  padding: 4px 14px 2px;
  color: var(--lfl-muted, #888);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ✅ Active sub-tab highlight (desktop) */
.nav-sub.active {
  background: var(--lfl-wash, rgba(255,255,255,0.10));
  border: 1px solid var(--lfl-border, rgba(255,255,255,0.18));
}


/* ============================================================
   MOBILE STYLES (Max Width 720px)
   ============================================================ */
@media screen and (max-width: 720px) {

  /* 1. RESET SCROLLING & PADDING */
  .top-bar-inner {
    padding-right: 10px !important;
    overflow: visible !important; /* Allow popup to overflow if needed */
  }

  /* 2. SHOW HAMBURGER BUTTON */
  .mobile-menu-btn {
    display: block;
    background: transparent;
    border: 1px solid var(--lfl-border, rgba(255,255,255,0.3));
    color: var(--lfl-text, #fff);
    font-size: 20px;
    border-radius: 4px;
    padding: 2px 10px;
    cursor: pointer;
    margin-left: 10px;
  }

  /* 3. MOBILE POPUP MENU (.nav-extras) */
  .nav-extras {
    display: none; /* Hidden until .active */
    
    position: fixed;
    top: 60px;       /* Below the header */
    right: 10px;
    width: 300px;    /* Wide enough for the full account-action labels */
    max-width: calc(100vw - 20px);

    /* The menu, not the page behind it, owns vertical scrolling. */
    max-height: calc(100vh - 70px);   /* Fallback */
    max-height: calc(100dvh - 70px);  /* Mobile browser-safe viewport */
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    
    background: var(--lfl-surface, #111);
    border: 1px solid var(--lfl-border, #333);
    padding: 15px 15px calc(28px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    border-radius: 10px;
    box-shadow: 0 10px 50px var(--lfl-shadow, rgba(0,0,0,0.9));
    z-index: 99999;
  }

  /* Show when active */
  .nav-extras.active {
    display: flex;
  }

  /* Freeze the document while the mobile navigation is open.
     The menu itself remains scrollable because it has overflow-y:auto. */
  html:has(.nav-extras.active),
  body:has(.nav-extras.active) {
    overflow: hidden;
  }

/* 4. ITEMS INSIDE MOBILE MENU */
  .nav-extras .top-link {
    width: 100%;
    text-align: left;
    margin: 0;
    display: block;
  }

  /* FIX: Stack the dropdown vertically (Column) so items go UNDER the button */
  .nav-extras .nav-dd {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column; /* This forces the menu to appear BELOW the button */
    align-items: stretch;   /* This ensures it uses the full width */
    padding-bottom: 0;      /* Remove the hover-bridge padding used on desktop */
  }

  .nav-extras .viewer-profile-menu,
  .lfl-owner-notification-menu {
    margin: 0;
    padding: 0;
  }

  /* Ensure the trigger button inside takes full width */
  .nav-extras .nav-dd .top-link {
    width: 100%;
    box-sizing: border-box;
  }

  /* Fix Login Area inside menu */
  .nav-extras .top-login-area,
  .nav-extras .nav-login-area {
    position: relative;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  /*
   * On desktop the connect/logout chooser is anchored to the right edge of
   * the tiny round login pill. Inside the narrow mobile panel that makes the
   * chooser grow off the left side and get clipped by the panel's scrolling
   * area. Anchor it to the full login row instead and open it inward.
   */
  .nav-extras .nav-login-pill {
    position: static;
    width: 100%;
    min-height: 40px;
    height: auto;
    padding: 9px 12px;
    box-sizing: border-box;
    border-radius: 8px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--lfl-wash-strong, rgba(0, 0, 0, .28));
    margin-left: 0;
  }

  .nav-extras .nav-login-pill::before {
    display: none;
  }

  .nav-extras .nav-login-menu {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 8px;
    box-sizing: border-box;
    z-index: 100000;
  }

  .nav-extras .nav-login-menu::before {
    display: none;
  }

  .nav-extras .nav-login-menu button {
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
  }

  /* Fix Resources Dot inside menu */
  .nav-more {
    position: static;
    transform: none;
    margin-top: 10px;
    font-size: 14px;
    display: block;
    text-align: left;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lfl-border, rgba(255,255,255,.20));
    border-radius: 8px;
    color: var(--lfl-text, #fff);
    background: var(--lfl-surface, #000);
  }

  .nav-more-dot {
    display: none;
  }

  .nav-more-label {
    display: inline;
  }



  /* 5. MOBILE SUB-MENUS (ALWAYS OPEN) */
  
  /* Hide the little arrow "▾" since it's always open */
  .nav-dd-trigger::after {
    display: none;
  }

  /* Force the menu to be ALWAYS visible (Flex) */
  .nav-dd .nav-dd-menu {
    display: flex !important;
    position: static;       /* Sit naturally under the button */
    width: 100%;
    box-shadow: none;       /* No floating shadow */
    border: none;           /* No border */
    background: transparent;/* Blend into background */
    
    margin-top: 2px;
    padding-left: 20px;     /* Indent sub-items so they look nested */
    padding-bottom: 10px;   /* Space after the group */
  }

  /* Style the sub-links to be smaller/dimmer to look like a list */
  .nav-sub {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--lfl-text, #ccc);            /* Slightly dimmer text */
    border-left: 1px solid var(--lfl-border, #444); /* Optional: cool tree line effect */
  }


/* ✅ Active sub-tab highlight (mobile) */
.nav-sub.active {
  color: var(--lfl-text, #fff);
  background: var(--lfl-wash, rgba(255,255,255,0.08));
  border-left: 1px solid var(--lfl-border, #fff);
}
  
}



.lfl-scrollnav{
  position:fixed;
  right:14px;
  bottom:14px;
  display:none;            /* hidden until scroll */
  z-index:9999;
}
.lfl-scrollbtn{
  width:42px;
  height:42px;
  display:block;
  margin-top:6px;
  border: 1px solid var(--lfl-border, #7c7f82);
  border-radius:8px;
  cursor:pointer;
  font-size:18px;
  line-height:38px;
  text-align:center;
  background: var(--lfl-surface, rgba(0,0,0,.65));
  transition: background .2s ease;
  color:var(--lfl-text, #fff);
}
.lfl-scrollbtn[hidden]{
  display:none !important;
}
.lfl-scrollbtn:hover{
  background: var(--lfl-wash-strong, rgba(255,255,255,.15));
}

.lfl-floataction{
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:14px;
  text-decoration:none;
  font-size:20px;
}
.lfl-floataction[hidden]{
  display:none !important;
}
.lfl-floataction--guest{
  border-color:var(--lfl-purple-border, #d8b4ff);
  background:var(--lfl-purple-solid, rgba(126, 53, 181, .92));
  box-shadow:0 4px 14px rgba(84, 26, 130, .38);
}
.lfl-floataction--guest:hover{
  background:var(--lfl-purple-solid, rgba(157, 79, 214, .98));
}


/* ============================================================
   MOBILE BOTTOM NAVIGATION
   ============================================================ */

.lfl-mobile-dock {
  display: none;
}

@media screen and (max-width: 720px) {
  /* Keep the final page content above the fixed dock. */
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Let the full hamburger panel appear above the bottom dock. */
  .nav-extras {
    z-index: 100020;
  }

  .lfl-mobile-dock {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 100010;

    width: min(360px, calc(100vw - 16px));
    min-height: 54px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;

    padding: 5px;
    border: 1px solid var(--lfl-border, rgba(255,255,255,.22));
    border-radius: 16px 16px 0 0;
    background: var(--lfl-surface, rgba(12,12,12,.94));
    box-shadow: 0 10px 34px var(--lfl-shadow, rgba(0,0,0,.65));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .lfl-mobile-dock:has(#lflDockNotificationBell:not([hidden])),
  .lfl-mobile-dock:has(#lflDockOwnerNotificationGroup:not([hidden])),
  .lfl-mobile-dock:has(#lflDockViewerProfile:not([hidden])),
  .lfl-mobile-dock:has(#lflDockGuestConnect:not([hidden])) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .lfl-mobile-dock:has(#lflDockNotificationBell:not([hidden])):has(#lflDockViewerProfile:not([hidden])),
  .lfl-mobile-dock:has(#lflDockOwnerNotificationGroup:not([hidden])):has(#lflDockViewerProfile:not([hidden])) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .lfl-dock-notification[hidden],
  .lfl-dock-viewer-profile[hidden],
  #lflDockGuestConnect[hidden] {
    display: none !important;
  }

  .lfl-dock-group {
    position: static;
    display: flex;
  }

  .lfl-dock-viewer-group[hidden],
  .lfl-dock-guest-group[hidden],
  .lfl-dock-owner-notification-group[hidden] {
    display: none !important;
  }

  .lfl-owner-notification-menu .nav-dd-menu {
    display: none !important;
  }

  .lfl-owner-notification-menu.open .nav-dd-menu {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    left: auto;
    width: min(230px, calc(100vw - 20px));
    display: flex !important;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--lfl-border, rgba(255,255,255,.14));
    border-radius: 12px;
    background: var(--lfl-surface, rgba(17,17,17,.98));
    box-shadow: 0 12px 34px var(--lfl-shadow, rgba(0,0,0,.72));
  }

  .lfl-owner-notification-menu .nav-sub {
    border-left: 0;
  }

  .lfl-dock-btn {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--lfl-text, #fff);
    text-decoration: none;
    font: inherit;
    font-size: 22px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .lfl-dock-btn:visited {
    color: var(--lfl-text, #fff);
  }

  .lfl-dock-btn:active,
  .lfl-dock-btn[aria-expanded="true"] {
    background: var(--lfl-wash, rgba(255,255,255,.13));
  }

  .lfl-dock-btn.is-active {
    background: var(--lfl-wash, rgba(255,255,255,.12));
    box-shadow: inset 0 0 0 1px var(--lfl-shadow-soft, rgba(255,255,255,.18));
  }

  .lfl-dock-btn.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 18px;
    height: 3px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: var(--lfl-selection, #fff);
  }

  .lfl-dock-btn.is-active[data-dock-section="live"] {
    background: var(--lfl-blue-wash, rgba(10,132,255,.22));
  }

  .lfl-dock-btn.is-active[data-dock-section="live"]::after {
    background: var(--lfl-blue-solid, #42a5ff);
    box-shadow: 0 0 7px rgba(66,165,255,.85);
  }

  .lfl-dock-btn.is-active[data-dock-section="notepad"] {
    background: var(--lfl-amber-wash, rgba(255,204,0,.16));
  }

  .lfl-dock-btn.is-active[data-dock-section="notepad"]::after {
    background: var(--lfl-amber-solid, #ffd84d);
    box-shadow: 0 0 7px rgba(255,216,77,.8);
  }

  .lfl-dock-btn.is-active[data-dock-section="nostr"] {
    background: var(--lfl-purple-wash, rgba(175,82,222,.2));
  }

  .lfl-dock-btn.is-active[data-dock-section="nostr"]::after {
    background: var(--lfl-purple-solid, #c77dff);
    box-shadow: 0 0 7px rgba(199,125,255,.82);
  }

  .lfl-dock-btn.is-active[data-dock-section="notifications"] {
    background: var(--lfl-wash, rgba(255,255,255,.12));
  }

  .lfl-dock-btn.is-active[data-dock-section="notifications"]::after {
    background: var(--lfl-selection, #f5f5f5);
    box-shadow: 0 0 7px var(--lfl-shadow, rgba(255,255,255,.72));
  }

  .lfl-dock-notification .lfl-notification-badge--activity {
    top: 1px;
    right: calc(50% - 24px);
  }

  .lfl-dock-notification .lfl-notification-badge--health {
    top: 1px;
    right: auto;
    left: calc(50% - 24px);
  }

  .lfl-dock-notification .lfl-notification-badge--email {
    top: auto;
    right: auto;
    bottom: 1px;
    left: calc(50% - 24px);
  }

  .lfl-dock-viewer-profile {
    display: grid;
    place-items: center;
    line-height: 1;
  }

  .lfl-dock-viewer-profile img {
    display: block;
    width: 34px;
    height: 34px;
    border: 1px solid var(--lfl-border, rgba(255,255,255,.32));
    border-radius: 999px;
    background: var(--lfl-surface-soft, #222);
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--lfl-shadow-soft, rgba(255,255,255,.07));
  }

  .lfl-dock-profile-panel {
    right: 5px;
    width: min(190px, calc(100vw - 20px));
  }

  .lfl-dock-panel.lfl-dock-login-panel {
    right: 5px;
    width: min(350px, calc(100vw - 20px));
    box-sizing: border-box;
  }

  .lfl-dock-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    width: min(230px, calc(100vw - 20px));
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px;
    border: 1px solid var(--lfl-border, rgba(255,255,255,.16));
    border-radius: 14px;
    background: var(--lfl-surface, rgba(17,17,17,.98));
    box-shadow: 0 12px 34px var(--lfl-shadow, rgba(0,0,0,.72));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .lfl-dock-panel[hidden] {
    display: none !important;
  }

  .lfl-dock-panel > [hidden] {
    display: none !important;
  }

  .lfl-dock-panel--left {
    left: 46px;
  }

  .lfl-dock-panel--right {
    right: 46px;
  }

  .lfl-dock-panel--center {
    left: 50%;
    transform: translateX(-50%);
  }

  .lfl-dock-panel-title {
    padding: 5px 10px 7px;
    color: var(--lfl-muted, #aaa);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .lfl-dock-panel-section + .lfl-dock-panel-section {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--lfl-border, rgba(255,255,255,.08));
  }

  .lfl-dock-panel-section-title {
    padding: 4px 10px 1px;
    color: var(--lfl-muted, #777);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .lfl-dock-panel a,
  .lfl-dock-panel > button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--lfl-text, #fff);
    font: inherit;
    font-size: 15px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .lfl-dock-panel > button.lfl-dock-connect-option {
    display: flex;
    align-items: center;
    gap: 9px;
    box-sizing: border-box;
    font-size: 14px;
    white-space: nowrap;
  }

  .lfl-dock-connect-option .nav-login-provider-badge {
    min-width: 55px;
  }

  .lfl-dock-panel a:hover,
  .lfl-dock-panel a:active,
  .lfl-dock-panel a.active,
  .lfl-dock-panel > button:hover,
  .lfl-dock-panel > button:active {
    background: var(--lfl-wash, rgba(255,255,255,.10));
  }

  .lfl-dock-panel > .lfl-dock-signout {
    color: var(--lfl-green-text, #baf7c8);
  }

  .lfl-dock-divider {
    height: 1px;
    margin: 6px 8px;
    background: var(--lfl-wash, rgba(255,255,255,.14));
    flex: 0 0 auto;
  }

  .lfl-dock-panel a.active {
    box-shadow: inset 3px 0 0 var(--lfl-shadow, #fff);
    font-weight: 700;
  }

  /* The existing arrows float just above the new dock. */
  .lfl-scrollnav {
    right: 10px;
    bottom: 72px;
    z-index: 100005;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    will-change: transform;
  }

  /* The full menu needs the bottom of the screen for Connect and Resources. */
  body:has(#navExtras.active) .lfl-mobile-dock,
  body:has(#navExtras.active) .lfl-scrollnav {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media screen and (max-width: 340px) {
  .lfl-dock-panel > button.lfl-dock-connect-option {
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 13px;
  }
}

/* Login offered from public content; browsing never opens this automatically. */
.lfl-browse-login { color: var(--lfl-text, #eee); background: var(--lfl-surface-soft, #202126); border: 1px solid var(--lfl-border, #555); border-radius: 14px; padding: 24px; width: min(360px, calc(100vw - 48px)); box-sizing: border-box; }
.lfl-browse-login::backdrop { background: rgba(0,0,0,.65); }
.lfl-browse-login h2 { font-size: 1.2rem; margin: 0 0 12px; }
.lfl-browse-login p { color: var(--lfl-muted, #bbb); margin: 0 0 18px; }
.lfl-browse-login button { display: block; width: 100%; padding: 12px; margin-top: 10px; border: 1px solid var(--lfl-border, #666); border-radius: 8px; background: var(--lfl-surface-hover, #303239); color: var(--lfl-text, #fff); cursor: pointer; font: inherit; }
.lfl-browse-login button:hover, .lfl-browse-login button:focus-visible { background: var(--lfl-blue-solid, #1479e8); }

/* Current destination: keep avatar status rings and unread badges independent. */
.top-bar .lfl-notification-link.active,
.top-bar .profile-link.active,
.top-bar .viewer-profile-trigger.active,
.top-bar .nav-more.active {
  border-radius: 8px;
  background: var(--lfl-blue-solid, #344b65);
  box-shadow: 0 0 0 4px #344b65, 0 0 0 5px #83baff;
  color: var(--lfl-on-accent, #fff);
}

/* Client identity cues: use the same visual mapping as avatar [LFL] [P] [A] actions. */
.nav-sub.lfl-client-nav,
.lfl-dock-panel a.lfl-client-nav {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lfl-client-nav::before {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 7px;
  color: #fff;
  font: 800 11px/1 system-ui, sans-serif;
  letter-spacing: .01em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.lfl-client-nav--lfl::before {
  content: "LFL";
  min-width: 36px;
  background: #1769aa;
}

.lfl-client-nav--primal::before {
  content: "P";
  background: #00c1fd;
  color: #062531;
}

.lfl-client-nav--amethyst::before {
  content: "A";
  background: #5756a3;
}

/* Keep navigation badges anchored to the image without clipping them. */
.lfl-nav-avatar-badge { display: inline-grid; position: relative; line-height: 0; }
.profile-circle.lfl-profile-badge-host > img { border-radius: inherit; }

/* More legible Pulse/Connect marks on desktop and mobile navigation avatars. */
.top-bar .lfl-profile-identity-badge,
.lfl-mobile-dock .lfl-profile-identity-badge { width: 18px; height: 18px; }

/* User-tested horizontal spacing keeps navigation marks clear of the avatar. */
.top-bar .lfl-profile-identity-badge--connect,
.lfl-mobile-dock .lfl-profile-identity-badge--connect { left: -11px; }
.top-bar .lfl-profile-identity-badge--pulse,
.lfl-mobile-dock .lfl-profile-identity-badge--pulse { right: -9px; }
