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

/* Profile avatar next to Live tab */
.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: #ffffff;
  flex-shrink: 0;
  border: 2px solid #ffffff;   /* default = offline gray */
}

/* OFFLINE = gray border */
.profile-circle.offline { border-color: #ffffff; }

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

/* Stream Day/config health overrides the ordinary live/offline ring. */
.profile-circle.activation-inactive,
.profile-circle.activation-config-error {
  border-color: #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 #ff7b86;
  border-radius: 999px;
  background: #9d101d;
  color: #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 rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: #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: rgba(77, 162, 255, .75);
  background: rgba(42, 129, 219, .16);
}

.lfl-notification-link.has-unread {
  border-color: #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: #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: #ff5362;
  box-shadow: 0 0 10px rgba(255, 63, 79, .55);
}

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

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

.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 #8fc8ff;
  border-radius: 999px;
  background: #1168b7;
  color: #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: #ff929d;
  background: #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: #ff9fd1;
  background: #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 #79baff;
  border-radius: 999px;
  background: #1168b7;
  color: #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: #ff929d;
  background: #b91d2c;
  box-shadow: 0 0 7px rgba(255, 63, 79, .48);
}

.lfl-notification-section-count[data-notification-section-count="email"] {
  border-color: #ff9fd1;
  background: #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: #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 #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) {
  .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;
  }

  .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:hover .viewer-profile-menu-list,
  .lfl-owner-notification-menu:hover .lfl-owner-notification-menu-list {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition-delay: .12s;
  }

  .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 #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;
}

/* A desktop pointer or keyboard focus opens the viewer menu immediately. */
@media (min-width: 721px) {
  .nav-dd.viewer-profile-menu:hover .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: #bbb;
  background-color: #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 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 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: #111;
  border-radius: 8px;
  border: 1px solid 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: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.nav-login-menu button:hover { background: 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 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: rgba(255, 255, 255, .09);
  border-color: 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: #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: #3ee47b;
}

.nav-login-provider-badge.is-missing .nav-login-provider-state {
  color: #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 rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: #f3f4f6;
  box-sizing: border-box;
  font-size: 18px;
  line-height: 1;
}

.nav-login-action-separator {
  height: 1px;
  margin: 9px 12px;
  background: 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: rgba(20,20,20,0.95);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px 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: rgba(255,255,255,0.08); }

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

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

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

/* ✅ Active sub-tab highlight (desktop) */
.nav-sub.active {
  background: rgba(255,255,255,0.10);
  border: 1px solid 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 rgba(255,255,255,0.3);
    color: #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: #111;
    border: 1px solid #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 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: 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 rgba(255,255,255,.20);
    border-radius: 8px;
    color: #fff;
    background: #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: #ccc;            /* Slightly dimmer text */
    border-left: 1px solid #444; /* Optional: cool tree line effect */
  }


/* ✅ Active sub-tab highlight (mobile) */
.nav-sub.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left: 1px solid #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 #7c7f82;
  border-radius:8px;
  cursor:pointer;
  font-size:18px;
  line-height:38px;
  text-align:center;
  background: rgba(0,0,0,.65);
  transition: background .2s ease;
  color:#fff;
}
.lfl-scrollbtn[hidden]{
  display:none !important;
}
.lfl-scrollbtn:hover{
  background: 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:#d8b4ff;
  background:rgba(126, 53, 181, .92);
  box-shadow:0 4px 14px rgba(84, 26, 130, .38);
}
.lfl-floataction--guest:hover{
  background: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 rgba(255,255,255,.22);
    border-radius: 16px 16px 0 0;
    background: rgba(12,12,12,.94);
    box-shadow: 0 10px 34px 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 rgba(255,255,255,.14);
    border-radius: 12px;
    background: rgba(17,17,17,.98);
    box-shadow: 0 12px 34px 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: #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: #fff;
  }

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

  .lfl-dock-btn.is-active {
    background: rgba(255,255,255,.12);
    box-shadow: inset 0 0 0 1px 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: #fff;
  }

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

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

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

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

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

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

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

  .lfl-dock-btn.is-active[data-dock-section="notifications"]::after {
    background: #f5f5f5;
    box-shadow: 0 0 7px 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 rgba(255,255,255,.32);
    border-radius: 999px;
    background: #222;
    object-fit: cover;
    box-shadow: 0 0 0 2px 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 rgba(255,255,255,.16);
    border-radius: 14px;
    background: rgba(17,17,17,.98);
    box-shadow: 0 12px 34px 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: #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 rgba(255,255,255,.08);
  }

  .lfl-dock-panel-section-title {
    padding: 4px 10px 1px;
    color: #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: #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: rgba(255,255,255,.10);
  }

  .lfl-dock-panel > .lfl-dock-signout {
    color: #baf7c8;
  }

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

  .lfl-dock-panel a.active {
    box-shadow: inset 3px 0 0 #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;
  }
}
