/* Force horizontal layout + compact sizing */
  .topbar-nav { --gap: 8px; --fs: .85rem; }

  /* Make any list the horizontal container (override frameworks) */
  .topbar-nav ul,
  .topbar-nav .nav,
  .topbar-nav .menu,
  .topbar-nav .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: var(--gap) !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  /* Ensure items don't span full width */
  .topbar-nav li {
    list-style: none !important;
    display: inline-flex !important;
    width: auto !important;
    margin: 0 !important;
  }

  /* Compact links */
  .topbar-nav a {
    display: inline-flex !important;
    align-items: center;
    gap: .4rem;
    font-size: var(--fs);
    line-height: 1.1;
    padding: .35rem .6rem;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
  }

  .topbar-nav a:hover { background: rgb(0, 41, 5); color: #ebe305; }
  .topbar-nav .active > a,
  .topbar-nav a.active { background: #2fbf71; color: #c3ad05; font-weight: 600; }

  /* Optional: flatten any submenus so they don't stack vertically */
  .topbar-nav li > ul { display: contents !important; }


  .topbar-nav li > ul {
    border-radius: 0 !important;
  }

  /* Flyout (submenu of submenu): to the right, centered at 50% */
  .topbar-nav li > ul li { position: relative; }
  .topbar-nav li > ul li > ul {
    display: none !important;              /* hidden until hover/focus */
    position: absolute;
    left: calc(100% + 8px);                /* to the right of parent menu */
    top: 50%;                              /* vertical midpoint of parent li */
    transform: translateY(-50%);           /* center the panel */
    margin: 0;                             /* remove inherited offsets */
    border-radius: 0 !important;           /* no rounding on flyout panel */
  }
  /* show on hover/focus */
  .topbar-nav li > ul li:hover > ul,
  .topbar-nav li > ul li:focus-within > ul {
    display: flex !important;
    flex-direction: column;
  }

  /* Flip to the left when near the right edge (dropstart) */
  .topbar-nav li > ul li.dropstart > ul {
    left: auto;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
  }
